← Back
Editing: UserAddressRepository.php
<?php namespace App\Repository; use App\Entity\UserAddress; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; /** * @method UserAddress|null find($id, $lockMode = null, $lockVersion = null) * @method UserAddress|null findOneBy(array $criteria, array $orderBy = null) * @method UserAddress[] findAll() * @method UserAddress[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class UserAddressRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, UserAddress::class); } /** * @return int|mixed|string */ public function clearExpiredAccess() { return $this->createQueryBuilder('u') ->delete() ->where('u.endDate < :endDate') ->setParameter('endDate', new \DateTime()) ->getQuery() ->getResult(); } // /** // * @return UserAddress[] Returns an array of UserAddress objects // */ /* public function findByExampleField($value) { return $this->createQueryBuilder('u') ->andWhere('u.exampleField = :val') ->setParameter('val', $value) ->orderBy('u.id', 'ASC') ->setMaxResults(10) ->getQuery() ->getResult() ; } */ /* public function findOneBySomeField($value): ?UserAddress { return $this->createQueryBuilder('u') ->andWhere('u.exampleField = :val') ->setParameter('val', $value) ->getQuery() ->getOneOrNullResult() ; } */ }
Save File
Cancel