Get all versions for given page
Example
$page = $pages->get(1234);
$versions = $pagesVersions->getPageVersions($page);
foreach($versions as $p) {
echo $p->get('_version')->version; // i.e. 2, 3, 4, etc.
}
Usage
// basic usage
$pageVersionInfo = $pagesVersions->getPageVersions(Page $page);
// usage with all arguments
$pageVersionInfo = $pagesVersions->getPageVersions(Page $page, array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
page | Page | |
options (optional) | array |
|
Return value
PageVersionInfo
[]|Page[]
- Returns Array of
Page
objects or array ofPageVersionInfo
objects ifgetInfo
requested. - When returning pages, version info is in
$page->_version
value of each page, which is aPageVersionInfo
object.
Exceptions
Method can throw exceptions on error:
WireException
$pagesVersions methods and properties
API reference based on ProcessWire core version 3.0.236