I can't find the answer in the documentation. I use symfony for an application, i have a database with a datetime for each of my table and would like to get only the row with the most recent datetime is there a function like
$repository->findOneById($id) to obtain this object ?
Best How To :
Here is a solution using QueryBuilder:
$repository = $this->getDoctrine()
$query = $repository->createQueryBuilder('p')
$product = $query->getResult();