add set root ids

This commit is contained in:
Yisroel Baum 2026-05-25 21:42:38 +03:00
parent a87c98a729
commit 7736b88802
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
4 changed files with 36 additions and 3 deletions

View file

@ -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[]
*/