dimanche 26 juin 2016

Getting row count after matching query call

I am trying to get the row count from a query, using doctrine and repository pattern.

This is the code I have:

$criteria = new \Doctrine\Common\Collections\Criteria();
        $criteria
        ->andWhere($criteria->expr()->eq('referrer', $referrer))
        ->andWhere($criteria->expr()->gte('date_creation', $date));

        return $this->em->getRepository($this->class)->matching(
    $criteria,
    array('id' => 'ASC')
    );

How can I get the number of matching rows from the returned object?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/295Snn5
via IFTTT

Aucun commentaire:

Enregistrer un commentaire