Skip to content

Commit

Permalink
Add interface for ContentRichEntityRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Aug 9, 2024
1 parent f36e36d commit b4cc47b
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions Content/Domain/Repository/ContentRichEntityRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

declare(strict_types=1);

/*
* This file is part of Sulu.
*
* (c) Sulu GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Sulu\Bundle\ContentBundle\Content\Domain\Repository;

use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;

/**
* @template T of ContentRichEntityInterface
*
* @phpstan-type ContentRichEntityRepositoryFilters array{
* identifiers?: array<string>,
* locale?: string|null,
* stage?: string|null,
* categoryIds?: int[],
* categoryKeys?: string[],
* categoryOperator?: 'AND'|'OR',
* tagIds?: int[],
* tagNames?: string[],
* tagOperator?: 'AND'|'OR',
* templateKeys?: string[],
* loadGhost?: bool,
* }
* @phpstan-type ContentRichEntityRepositorySortBys array{
* title?: 'asc'|'desc',
* authored?: 'asc'|'desc',
* workflowPublished?: 'asc'|'desc',
* }
* @phpstan-type ContentRichEntityRepositorySelects array{
* content_admin?: bool,
* content_website?: bool,
* with-excerpt-tags?: bool,
* with-excerpt-categories?: bool,
* with-excerpt-categories-translation?: bool,
* with-excerpt-image?: bool,
* with-excerpt-image-translation?: bool,
* with-excerpt-icon?: bool,
* with-excerpt-icon-translation?: bool,
* }
*/
interface ContentRichEntityRepositoryInterface
{
/**
* @param ContentRichEntityRepositoryFilters $filters
* @param ContentRichEntityRepositorySortBys $sortBys
* @param ContentRichEntityRepositorySelects $selects
*
* @return iterable<T>
*/
public function findBy(
array $filters = [],
array $sortBys = [],
array $selects = [],
): iterable;

/**
* @param ContentRichEntityRepositoryFilters $filters
*/
public function countBy(
array $filters = [],
): int;
}

0 comments on commit b4cc47b

Please sign in to comment.