TaxonomyTreeServiceInterface
TaxonomyTreeServiceInterface.php
:
13
Methods¶
contains() ¶
TaxonomyTreeServiceInterface.php
:
41
Returns true if $needle is a descendant of a given $haystack.
|
|
Entry is considered as descendant if it's the entry itself, one of its direct children, one of the children's direct children, and so on.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$needle | TaxonomyEntry | - | - |
$haystack | TaxonomyEntry | - | - |
Return values
bool
getAncestor() ¶
TaxonomyTreeServiceInterface.php
:
33
Returns the ancestor of a given entry at a given level.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$entry | TaxonomyEntry | - | - |
$level | int | - |
The level of the ancestor to return (starting from root). Must be greater than 0. |
Return values
Tags
getPath() ¶
TaxonomyTreeServiceInterface.php
:
24
Returns the path to the given entry.
|
|
The path is an ordered iterable of entries starting from the root entry and ending with the given entry.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$entry | TaxonomyEntry | - | - |
Return values
iterable<string|int, TaxonomyEntry>