createQueryBuilder('t') ->andWhere('t.exampleField = :val') ->setParameter('val', $value) ->orderBy('t.id', 'ASC') ->setMaxResults(10) ->getQuery() ->getResult() ; } */ /* public function findOneBySomeField($value): ?Transaction { return $this->createQueryBuilder('t') ->andWhere('t.exampleField = :val') ->setParameter('val', $value) ->getQuery() ->getOneOrNullResult() ; } */ public function fromDateTime($user, $dateT): ?Transaction { try { return $this->createQueryBuilder('t') ->andWhere('t.user = :user') ->andWhere('t.dateTimeCreated >= :dateT') ->setParameter('user', $user) ->setParameter('dateT', $dateT) ->getQuery() ->getOneOrNullResult(); } catch (NonUniqueResultException $e) { return null; } } }