Files
piratepoet/lib/Form/FormsRepository.php
Pavel Dohnal 4da5b2e5c4 Add type hints
[MAILPOET-1798]
2020-02-17 19:20:36 +00:00

36 lines
916 B
PHP

<?php
namespace MailPoet\Form;
use MailPoet\Doctrine\Repository;
use MailPoet\Entities\FormEntity;
/**
* @method FormEntity[] findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null)
* @method FormEntity[] findAll()
* @method FormEntity|null findOneBy(array $criteria, array $orderBy = null)
* @method FormEntity|null findOneById(mixed $id)
* @method void persist(FormEntity $entity)
* @method void remove(FormEntity $entity)
*/
class FormsRepository extends Repository {
protected function getEntityClassName() {
return FormEntity::class;
}
/**
* @return FormEntity[]
*/
public function findAllNotDeleted(): array {
return $this->entityManager
->createQueryBuilder()
->select('f')
->from(FormEntity::class, 'f')
->where('f.deletedAt IS NULL')
->orderBy('f.updatedAt', 'desc')
->getQuery()
->getResult();
}
}