Cache the trees structures for treeViews used in the sidebar.

This commit is contained in:
Jan Böhmer 2020-01-02 18:45:41 +01:00
parent 9668d1084b
commit ad69c32832
13 changed files with 653 additions and 70 deletions

View file

@ -26,6 +26,7 @@ namespace App\Entity\Base;
use App\Entity\Attachments\AttachmentContainingDBElement;
use App\Validator\Constraints\NoneOfItsChildren;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
@ -244,13 +245,16 @@ abstract class StructuralDBElement extends AttachmentContainingDBElement
*
* @param bool $recursive if true, the search is recursive
*
* @return static[] all subelements as an array of objects (sorted by their full path)
* @return Collection<static> all subelements as an array of objects (sorted by their full path)
*/
public function getSubelements(): iterable
{
return $this->children;
}
/**
* @return Collection<static>
*/
public function getChildren(): iterable
{
return $this->children;