* * @method PostcodeLatLng|null find($id, $lockMode = null, $lockVersion = null) * @method PostcodeLatLng|null findOneBy(array $criteria, array $orderBy = null) * @method PostcodeLatLng[] findAll() * @method PostcodeLatLng[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class PostcodeLatLngRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, PostcodeLatLng::class); } public function findPostcodeLatLng(int $id): ?PostcodeLatLng { return $this->createQueryBuilder('postcode_lat_lng') ->andWhere('postcode_lat_lng.id = :val') ->setParameter('val', $id) ->getQuery() ->getOneOrNullResult() ; } public function findOneByPostcode(string $postcode): ?PostcodeLatLng { return $this->createQueryBuilder('postcode_lat_lng') ->andWhere('postcode_lat_lng.postcode = :val') ->setParameter('val', $postcode) ->setMaxResults(1) ->getQuery() ->getOneOrNullResult() ; } // /** // * @return PostcodeLatLng[] Returns an array of PostcodeLatLng objects // */ // public function findByExampleField($value): array // { // return $this->createQueryBuilder('u') // ->andWhere('u.exampleField = :val') // ->setParameter('val', $value) // ->orderBy('u.id', 'ASC') // ->setMaxResults(10) // ->getQuery() // ->getResult() // ; // } // public function findOneBySomeField($value): ?PostcodeLatLng // { // return $this->createQueryBuilder('u') // ->andWhere('u.exampleField = :val') // ->setParameter('val', $value) // ->getQuery() // ->getOneOrNullResult() // ; // } }