mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-10 08:56:13 +01:00
tea/Classes/Domain/Repository/TeaRepository.php
Oliver Klee 7f21991fa5
[TASK] Improve the type annotations for TeaRepository (#1266)
This fixes the last remaining PHPStan level 6 warning.
2024-05-06 12:35:12 +02:00

32 lines
830 B
PHP

<?php
declare(strict_types=1);
namespace TTN\Tea\Domain\Repository;
use TTN\Tea\Domain\Model\Tea;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
use TYPO3\CMS\Extbase\Persistence\Repository;
/**
* @extends Repository<Tea>
*/
class TeaRepository extends Repository
{
protected $defaultOrderings = ['title' => QueryInterface::ORDER_ASCENDING];
/**
* @param positive-int $ownerUid
*
* @return QueryResultInterface<Tea>
*/
public function findByOwnerUid(int $ownerUid): QueryResultInterface
{
$query = $this->createQuery();
$query->setQuerySettings($query->getQuerySettings()->setRespectStoragePage(false));
$query->matching($query->equals('ownerUid', $ownerUid));
return $query->execute();
}
}