Copied!

TaxonomyTreeServiceInterface

TaxonomyTreeServiceInterface.php : 13

Methods

publiccontains()

TaxonomyTreeServiceInterface.php : 41

Returns true if $needle is a descendant of a given $haystack.

public contains(TaxonomyEntry $needle, TaxonomyEntry $haystack) : bool

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

publicgetAncestor()

TaxonomyTreeServiceInterface.php : 33

Returns the ancestor of a given entry at a given level.

public getAncestor(TaxonomyEntry $entry, int $level) : TaxonomyEntry

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

TaxonomyEntry

Tags
Throws
NotFoundException

If the entry has no ancestor at the given level

publicgetPath()

TaxonomyTreeServiceInterface.php : 24

Returns the path to the given entry.

public getPath(TaxonomyEntry $entry) : iterable<string|int, TaxonomyEntry>

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>

Tags
Deprecated

Since ibexa/storefront 4.5: The "TaxonomyTreeServiceInterface::getPath()" method is deprecated, will be removed in 5.0. Use Ibexa\Contracts\Taxonomy\Service\TaxonomyServiceInterface::getPath() instead.