PagePath
final readonly class \
- Implements
- IteratorAggregate, Countable
The path of a page in the page tree, ordered from the root level down to the page itself, as editors see it in the backend.
A path is incomplete if it does not reach the root level: a page in between is deleted or missing, or the path was resolved for a user and ends below the first page the user must not see. The path of a page the user must not see is empty.
Page objects are only created when they are accessed.
Tags
Table of Contents
Interfaces
- IteratorAggregate
- Countable
Methods
- __construct() : mixed
- count() : int
- endBelow() : self
- Ends the path below the lowest of the given pages, for example pages hidden from the user.
- getIterator() : Generator<int, Page>
- getPages() : array<int, Page>
- isComplete() : bool
- Whether the path starts on the root level of the page tree.
Methods
__construct()
public
__construct(PageAncestry $ancestry) : mixed
Parameters
- $ancestry : PageAncestry
Internal
Use PageAncestryResolver::resolvePath() or resolveShownPath() to create a page path
count()
public
count() : int
Return values
intendBelow()
Ends the path below the lowest of the given pages, for example pages hidden from the user.
public
endBelow(array<int, int> $pageIds) : self
Parameters
- $pageIds : array<int, int>
Return values
selfgetIterator()
public
getIterator() : Generator<int, Page>
Return values
Generator<int, Page>getPages()
public
getPages() : array<int, Page>
Return values
array<int, Page> —Pages, ordered from the root level to the page
isComplete()
Whether the path starts on the root level of the page tree.
public
isComplete() : bool