mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 12:40:08 +02:00
Implemented a filter constraint for entities
This commit is contained in:
parent
0bc9d8cba1
commit
c9151c65ba
13 changed files with 810 additions and 27 deletions
|
@ -84,10 +84,20 @@ class NodesListBuilder
|
|||
return $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) {
|
||||
// Invalidate when groups, a element with the class or the user changes
|
||||
$item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]);
|
||||
/** @var StructuralDBElementRepository */
|
||||
$repo = $this->em->getRepository($class_name);
|
||||
|
||||
return $repo->toNodesList($parent);
|
||||
return $this->em->getRepository($class_name)->toNodesList($parent);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a flattened list of all (recursive) children elements of the given AbstractStructuralDBElement.
|
||||
* The value is cached for performance reasons.
|
||||
*
|
||||
* @template T
|
||||
* @param T $element
|
||||
* @return T[]
|
||||
*/
|
||||
public function getChildrenFlatList(AbstractStructuralDBElement $element): array
|
||||
{
|
||||
return $this->typeToNodesList(get_class($element), $element);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue