private function getByMethodAndStatesFromDateQuery()
    {
        if (null !== $this->byMethodAndStatesFromDateQuery) {
            return $this->byMethodAndStatesFromDateQuery;
        }

        $qb = $this->createQueryBuilder('p');

        $query = $qb
            ->andWhere($qb->expr()->eq('p.method', ':method'))
            ->andWhere($qb->expr()->in('p.state', ':states'))
            ->andWhere($qb->expr()->gte('p.createdAt', ':date'))
            ->addOrderBy('p.createdAt', 'ASC')
            ->getQuery()
            ->useQueryCache(true);

        return $this->byMethodAndStatesFromDateQuery = $query;
    }