options
into @Tree("closure-table", options)
. ancestorColumnName
and descandantColumnName
are callback functions, which receive primary column's metadata and return column's name.TreeRepository
:trees
will be following:TreeRepository
:findTrees
- Returns all trees in the database with all their children, children of children, etc.findRoots
- Roots are entities that have no ancestors. Finds them all. Does not load children leafs.findDescendants
- Gets all children (descendants) of the given entity. Returns them all in a flat array.findDescendantsTree
- Gets all children (descendants) of the given entity. Returns them in a tree - nested into each other.createDescendantsQueryBuilder
- Creates a query builder used to get descendants of the entities in a tree.countDescendants
- Gets number of descendants of the entity.findAncestors
- Gets all parent (ancestors) of the given entity. Returns them all in a flat array.findAncestorsTree
- Gets all parent (ancestors) of the given entity. Returns them in a tree - nested into each other.createAncestorsQueryBuilder
- Creates a query builder used to get ancestors of the entities in a tree.countAncestors
- Gets the number of ancestors of the entity.relations
- Indicates what relations of entity should be loaded (simplified left join form).