mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-25 08:36:12 +01:00
eeda862e77
The `Product` namespace segment in the domain model namespace `TTN\Tea\Domain\Model` currently serves no purpose and only adds confusion. So let's simplify the extension structure accordingly. (I intended to use this to demonstrate DDD contexts, but never built enough models in the Tea extension for this to actually make sense.) Fixes #1008
32 lines
788 B
PHP
32 lines
788 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace TTN\Tea\Domain\Repository;
|
|
|
|
use TTN\Tea\Domain\Model\Tea;
|
|
use TTN\Tea\Domain\Repository\Traits\StoragePageAgnosticTrait;
|
|
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
|
|
{
|
|
use StoragePageAgnosticTrait;
|
|
|
|
protected $defaultOrderings = ['title' => QueryInterface::ORDER_ASCENDING];
|
|
|
|
/**
|
|
* @param positive-int $ownerUid
|
|
*/
|
|
public function findByOwnerUid(int $ownerUid): QueryResultInterface
|
|
{
|
|
$query = $this->createQuery();
|
|
$query->matching($query->equals('ownerUid', $ownerUid));
|
|
|
|
return $query->execute();
|
|
}
|
|
}
|