2018-05-25 16:19:12 +02:00
|
|
|
<?php
|
2019-12-07 12:13:32 +01:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-01-16 15:21:21 +01:00
|
|
|
namespace TTN\Tea\Domain\Repository;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
2024-01-16 15:21:21 +01:00
|
|
|
use TTN\Tea\Domain\Model\Tea;
|
2018-05-25 17:38:51 +02:00
|
|
|
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
|
2023-06-21 09:16:13 +02:00
|
|
|
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
2018-05-25 16:19:12 +02:00
|
|
|
use TYPO3\CMS\Extbase\Persistence\Repository;
|
|
|
|
|
|
|
|
/**
|
2022-04-03 02:24:55 +02:00
|
|
|
* @extends Repository<Tea>
|
2018-05-25 16:19:12 +02:00
|
|
|
*/
|
|
|
|
class TeaRepository extends Repository
|
|
|
|
{
|
2018-05-25 17:38:51 +02:00
|
|
|
protected $defaultOrderings = ['title' => QueryInterface::ORDER_ASCENDING];
|
2023-06-21 09:16:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param positive-int $ownerUid
|
2024-05-06 12:35:12 +02:00
|
|
|
*
|
|
|
|
* @return QueryResultInterface<Tea>
|
2023-06-21 09:16:13 +02:00
|
|
|
*/
|
|
|
|
public function findByOwnerUid(int $ownerUid): QueryResultInterface
|
|
|
|
{
|
|
|
|
$query = $this->createQuery();
|
2024-04-15 11:13:57 +02:00
|
|
|
$query->setQuerySettings($query->getQuerySettings()->setRespectStoragePage(false));
|
2023-06-21 09:16:13 +02:00
|
|
|
$query->matching($query->equals('ownerUid', $ownerUid));
|
|
|
|
|
|
|
|
return $query->execute();
|
|
|
|
}
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|