Documentation

PageCollectionInterface extends Traversable, ArrayAccess, Countable, Serializable

Interface PageCollectionInterface

Tags
template
template
extends
extends

Table of Contents

Methods

addPage()  : $this
Add a single page to a collection
adjacentSibling()  : PageInterface|PageCollectionInterface|false
Returns the adjacent sibling based on a direction.
batch()  : array<string|int, PageCollectionInterface>
Split collection into array of smaller collections.
copy()  : static
Create a copy of this collection
currentPosition()  : int|null
Returns the item in the current position.
dateRange()  : PageCollectionInterface
Returns the items between a set of date ranges of either the page date field (default) or an arbitrary datetime page field where start date and end date are optional Dates must be passed in as text that strtotime() can process http://php.net/manual/en/function.strtotime.php
intersect()  : PageCollectionInterface
Intersect another collection with the current collection
isFirst()  : bool
Check to see if this item is the first in the collection.
isLast()  : bool
Check to see if this item is the last in the collection.
merge()  : PageCollectionInterface
Merge another collection with the current collection
modular()  : PageCollectionInterface
Creates new collection with only modules
modules()  : PageCollectionInterface
Creates new collection with only modules
nextSibling()  : PageInterface
Gets the next sibling based on current position.
nonModular()  : PageCollectionInterface
Creates new collection with only non-module pages
nonPublished()  : PageCollectionInterface
Creates new collection with only non-published pages
nonRoutable()  : PageCollectionInterface
Creates new collection with only non-routable pages
nonVisible()  : PageCollectionInterface
Creates new collection with only non-visible pages
ofOneOfTheseAccessLevels()  : PageCollectionInterface
Creates new collection with only pages of one of the specified access levels
ofOneOfTheseTypes()  : PageCollectionInterface
Creates new collection with only pages of one of the specified types
ofType()  : PageCollectionInterface
Creates new collection with only pages of the specified type
order()  : PageCollectionInterface
Reorder collection.
pages()  : PageCollectionInterface
Creates new collection with only pages
params()  : array<string|int, mixed>
Get the collection params
prevSibling()  : PageInterface
Gets the previous sibling based on current position.
published()  : PageCollectionInterface
Creates new collection with only published pages
routable()  : PageCollectionInterface
Creates new collection with only routable pages
setParams()  : $this
Set parameters to the Collection
toArray()  : array<string|int, mixed>
Converts collection into an array.
toExtendedArray()  : array<string|int, mixed>
Get the extended version of this Collection with each page keyed by route
visible()  : PageCollectionInterface
Creates new collection with only visible pages

Methods

currentPosition()

Returns the item in the current position.

public currentPosition(string $path) : int|null
Parameters
$path : string

the path the item

Return values
int|null

The index of the current page, null if not found.

dateRange()

Returns the items between a set of date ranges of either the page date field (default) or an arbitrary datetime page field where start date and end date are optional Dates must be passed in as text that strtotime() can process http://php.net/manual/en/function.strtotime.php

public dateRange([string|null $startDate = null ][, string|null $endDate = null ][, string|null $field = null ]) : PageCollectionInterface
Parameters
$startDate : string|null = null
$endDate : string|null = null
$field : string|null = null
Tags
phpstan-return

PageCollectionInterface<TKey,T>

throws
Exception
Return values
PageCollectionInterface

isFirst()

Check to see if this item is the first in the collection.

public isFirst(string $path) : bool
Parameters
$path : string
Return values
bool

True if item is first.

isLast()

Check to see if this item is the last in the collection.

public isLast(string $path) : bool
Parameters
$path : string
Return values
bool

True if item is last.

ofOneOfTheseAccessLevels()

Creates new collection with only pages of one of the specified access levels

public ofOneOfTheseAccessLevels(array<string|int, mixed> $accessLevels) : PageCollectionInterface
Parameters
$accessLevels : array<string|int, mixed>
Tags
phpstan-return

PageCollectionInterface<TKey,T>

Return values
PageCollectionInterface

The collection

ofOneOfTheseTypes()

Creates new collection with only pages of one of the specified types

public ofOneOfTheseTypes(array<string|int, string> $types) : PageCollectionInterface
Parameters
$types : array<string|int, string>
Tags
phpstan-return

PageCollectionInterface<TKey,T>

Return values
PageCollectionInterface

The collection

order()

Reorder collection.

public order(string $by[, string $dir = 'asc' ][, array<string|int, mixed>|null $manual = null ][, string|null $sort_flags = null ]) : PageCollectionInterface
Parameters
$by : string
$dir : string = 'asc'
$manual : array<string|int, mixed>|null = null
$sort_flags : string|null = null
Tags
phpstan-return

PageCollectionInterface<TKey,T>

Return values
PageCollectionInterface

params()

Get the collection params

public params() : array<string|int, mixed>
Return values
array<string|int, mixed>

setParams()

Set parameters to the Collection

public setParams(array<string|int, mixed> $params) : $this
Parameters
$params : array<string|int, mixed>
Return values
$this

toArray()

Converts collection into an array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toExtendedArray()

Get the extended version of this Collection with each page keyed by route

public toExtendedArray() : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

        
On this page

Search results