I use Doctrine in Symfony2. Here is the code:
$repository = $this->getDoctrine()->getRepository('AcmeCrawlerBundle:Trainings');
$allActive = $repository->findByStatus('(Active)');
How can I take allByStatus WITH minimal realId? I mean, one row by status “(Active)” and minimal “realId”.
Thank you!
Upd. I’m so stu… I can find just first and watch it’s realId, cause i saved it in cycle… Thank you for advice!
You can overload the findByStatus function in your repository to use an orderby close in your query builder