for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Gesdinet\JWTRefreshTokenBundle\Entity;
use Doctrine\ORM\EntityRepository;
/**
* RefreshTokenRepository.
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class RefreshTokenRepository extends EntityRepository
{
* @param null $datetime
* @return RefreshToken[]
public function findInvalid($datetime = null)
$datetime = (null === $datetime) ? new \DateTime() : $datetime;
return $this->createQueryBuilder('u')
->where('u.valid < :datetime')
->setParameter(':datetime', $datetime)
->getQuery()
->getResult();
}