Add a new page version and return the added version number
Example
$page = $pages->get(1234);
$version = $pagesVersions->addPageVersion($page);
echo "Added version $version for page $page";
Usage
// basic usage
$int = $pagesVersions->addPageVersion(Page $page);
// usage with all arguments
$int = $pagesVersions->addPageVersion(Page $page, array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
page | Page | |
options (optional) | array |
|
Return value
int
Version number or 0 if no version created
Exceptions
Method can throw exceptions on error:
WireException
or\PDOException
$pagesVersions methods and properties
API reference based on ProcessWire core version 3.0.236