I have the following code in my Symfony2 Repository Class...
$query = $this->createQueryBuilder('foo') ->where('foo.bar = :id') ->setParameter('id', $myID) ->getQuery();
How do I get the number of rows found by the database?
Thanks in advance
Laravel is preferred by developers for its fast development, performance, and high speed. Whereas, Symfony is suitable for the development of complex and large-size web applications effortlessly. We've done a full analysis of the features of each framework's capabilities, as well as its pros and cons.
Symfony is a feature-rich back-end framework that is used to build complex applications. Many developers still prefer the lightweight Silex micro-framework or the Symfony MicroKernel, and Symfony is a widely used application framework among open-source developers.
Symfony is an open-source PHP web application framework, designed for developers who need a simple and elegant toolkit to create full-featured web applications.
Ask me anything! Hi all, I created Symfony in 2005, one of the most popular PHP frameworks.
You need to execute DQL to do something you want.
$query = $this->createQueryBuilder() ->from('foo', 'f') ->where('foo.bar = :id') ->setParameter('id', $myID) ->getQuery(); $total = $query->select('COUNT(f)') ->getQuery() ->getSingleScalarResult();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With