add set root ids
This commit is contained in:
parent
a87c98a729
commit
7736b88802
4 changed files with 36 additions and 3 deletions
|
|
@ -37,6 +37,20 @@ class FakeElementRepository implements ElementRepository
|
|||
return $this->cloneElement($this->elementsById[$id]);
|
||||
}
|
||||
|
||||
public function findRootBySet(DomainSet $set): ?Element
|
||||
{
|
||||
foreach ($this->elementsById as $element) {
|
||||
if (
|
||||
$element->getSet()->getId() === $set->getId()
|
||||
&& $element->getParentElement() === null
|
||||
) {
|
||||
return $this->cloneElement($element);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Element[]
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue