31 lines
569 B
PHP
31 lines
569 B
PHP
<?php
|
|
|
|
namespace App\Element;
|
|
|
|
use App\Set\Set;
|
|
use DomainException;
|
|
|
|
interface ElementRepository
|
|
{
|
|
/**
|
|
* @throws DomainException
|
|
*/
|
|
public function create(CreateElementDto $dto): Element;
|
|
|
|
public function find(int $id): ?Element;
|
|
|
|
/**
|
|
* @return list<Element>
|
|
*/
|
|
public function findBySet(Set $set): array;
|
|
|
|
/**
|
|
* @return list<Element>
|
|
*/
|
|
public function findTopLevelBySet(Set $set): array;
|
|
|
|
/**
|
|
* @return list<Element>
|
|
*/
|
|
public function findByParentElement(Element $parentElement): array;
|
|
}
|