class Page extends Collection implements ObjectInterface, ObjectInterface, AssignableObjectInterface, TreeInterface, SiteAggregateInterface, ExportableInterface (View source)

The page object in Concrete encapsulates all the functionality used by a typical page and their contents including blocks, page metadata, page permissions.

Traits

Properties

protected PageController|null $controller

The page controller.

protected int[]|null $blocksAliasedFromMasterCollection

The list of block IDs that are alias.

protected int|null $cPointerOriginalID

The original cID of a page (if it's a page alias).

protected int|null $cPointerOriginalSiteTreeID

The original siteTreeID of a page (if it's a page alias).

$cPointerExternalLink

The link for the aliased page.

protected bool|int|null $cPointerExternalLinkNewWindow

Should the alias link to be opened in a new window?

protected bool|int|null $isMasterCollection

Is this page a page default?

protected int|null $cInheritPermissionsFromCID

The ID of the page from which this page inherits permissions from.

protected bool $cIsSystemPage

Is this a system page?

protected int|null $siteTreeID

The site tree ID.

Tree|null deprecated $siteTree

Methods

assignPermissions($userOrGroup, $permissions = [], $accessType = Key::ACCESS_TYPE_INCLUDE, $cascadeToChildren = true)

No description

static Page
getByPath(string $path, string $version = 'RECENT', TreeInterface $tree = null)

Get a page given its path.

static Page
getByID(int $cID, string $version = 'RECENT')

  • Get a page given its ID.

__construct()

Initialize collection until we populate it.

getExporter()

No description

populatePage(mixed $cInfo, string $where, string|int $cvID)

Read the data from the database.

getJSONObject()

Return a representation of the Page object as something easily serializable.

getPageController()

Get the page controller.

bool
isEditMode()

Is the page in edit mode?

int
getPackageID()

Get the package ID for a page (page thats added by a package) (returns 0 if its not in a package).

string|null
getPackageHandle()

Get the handle the the package that added this page.

false
isArrangeMode() deprecated

No description

forceCheckIn()

Forces the page to be checked in if its checked out.

static 
forceCheckInForAllPages()

No description

bool
isAdminArea()

Is this a dashboard page?

static Page
getFromRequest(Request $request)

Uses a Request object to determine which page to load. Queries by path and then by cID.

processArrangement(int $area_id, int $moved_block_id, int[] $block_order)

Persist the data associated to a block when it has been moved around in the page.

bool|null
isCheckedOut()

Is the page checked out?

string
getCollectionCheckedOutUserName()

Gets the user that is editing the current page.

bool
isCheckedOutByMe()

Checks if the page is checked out by the current user.

bool
isGeneratedCollection()

Checks if the page is a single page.

setPermissionsToOverride()

No description

removePermissions(Group|Group[]|User|UserInfo|User $userOrGroup, string[] $permissions = [])

Remove specific permission keys for a specific access entity (user, group, group combination).

static Page
getDraftsParentPage(Site $site = null)

Get the drafts parent page for a specific site.

static Page[]
getDrafts(Site $site)

Get the list of draft pages in a specific site.

bool
isPageDraft()

Is this a draft page?

static string[]
setController(PageController|null $controller)

Set the page controller.

getController() deprecated

No description

assignPermissionSet(SimpleXMLElement $px)

This is the legacy function that is called just by xml. We pass these values in as though they were the old ones.

int
addCollectionAlias($c)

Make an alias to a page.

updateCollectionAliasExternal(string $cName, string $cLink, bool $newWindow = 0)

Update the name, link, and to open in a new window for an external link.

int
addCollectionAliasExternal(string $cName, string $cLink, bool $newWindow = 0)

Add a new external link as a child of this page.

bool
isSystemPage()

Returns true if a page is a system page. A system page is either a page that is outside the site tree (has a site tree ID of 0) or a page that is in the site tree, but whose parent starts at 0. That means its a root level page. Why do we need this separate boolean then? Because we need to easily be able to filter all pages by whether they're a system page even if we don't necessarily know where their starting page is.

string
getCollectionIcon()

Gets the icon for a page (also fires the on_page_get_icon event).

int|null
removeThisAlias()

Remove an external link/alias.

array
populateRecursivePages(array $pages, array $pageRow, int $cParentID, int $level, bool $includeThisPage = true)

Create an array containing data about child pages.

int
queueForDeletionSort(array $a, array $b)

Sort a list of pages, so that the order is correct for the deletion.

int
queueForDuplicationSort(array $a, array $b)

Sort a list of pages, so that the order is correct for the duplication.

queueForDeletion()

Add this page and its subpages to the Delete Page queue.

queueForDeletionRequest(Queue|null $queue = null, bool $includeThisPage = true)

Add this page and its subpages to the Delete Page Requests queue (or to a custom queue).

queueForDuplication(Page $destination, bool $includeParent = true)

Add this page and its subpages to the Copy Page queue.

export(SimpleXMLElement $pageNode) deprecated

No description

int|null
getCollectionCheckedOutUserID()

Get the uID for a page that is checked out (if any).

string
getCollectionPath()

Get the path of this page.

PagePath|null
getCollectionPathObject()

Returns the PagePath object for the current page.

addAdditionalPagePath(string $cPath, bool $commit = true)

Add a non-canonical page path to the current page.

setCanonicalPagePath(string $cPath, bool $isAutoGenerated = false)

Set the canonical page path for a page.

getPagePaths()

Get all the page paths of this page.

getAdditionalPagePaths()

Get all the non-canonical page paths of this page.

clearPagePaths()

Clears all page paths for a page.

string
getCollectionLink(bool $appendBaseURL = false)

Returns full url for the current page.

int|null
getSiteTreeID()

No description

getSite()

No description

Tree|null
getSiteTreeObject()

No description

static 
getCollectionPathFromID($cID)

Returns the path for a page from its cID.

int|null
getCollectionUserID()

Get the uID of the page author (if any).

string
getCollectionHandle()

Get the page handle.

string|null
getCollectionTypeName() deprecated

No description

string|null
getPageTypeName()

Get the display name of the page type (if available).

getCollectionTypeID() deprecated

No description

int|null
getPageTypeID()

Get the Collection Type ID.

Type|null
getPageTypeObject()

Get the page type object.

int
getPageTemplateID()

Get the Page Template ID.

Template|null
getPageTemplateObject()

Get the Page Template Object (if available).

string|false
getPageTemplateHandle()

Get the handle of the Page Template (if available).

string|false
getPageTypeHandle()

Get the handle of the Page Type (if available).

string|false
getCollectionTypeHandle() deprecated

No description

int|null
getCollectionThemeID()

Get the theme ID for the collection (if available).

bool
isBlockAliasedFromMasterCollection(Block $b)

Check if a block is an alias from a page default.

getCollectionThemeObject()

Get the collection's theme object.

string
getCollectionName()

Get the page name.

int
getCollectionPointerID()

Get the collection ID for the aliased page (returns 0 unless used on an actual alias).

string|null
getCollectionPointerExternalLink()

Get the link for the aliased page.

bool|int|null
openCollectionPointerExternalLinkInNewWindow()

Should the alias link to be opened in a new window?

bool
isAliasPage()

Is this page an alias page of another page?

bool
isAliasPageOrExternalLink()

Is this page an alias page or an external link?

bool
isAlias() deprecated

No description

bool
isExternalLink()

Is this page an external link?

int
getCollectionPointerOriginalID()

Get the original cID of a page (if it's a page alias).

string
getCollectionFilename()

Get the file name of a page (single pages).

string
getCollectionDatePublic()

Get the date/time when the current version was made public (or a falsy value if the current version doesn't have public date).

DateTime|null
getCollectionDatePublicObject()

Get the date/time when the current version was made public (or NULL value if the current version doesn't have public date).

string
getCollectionDescription()

Get the description of a page.

int|null
getCollectionParentID()

Ges the cID of the parent page.

static int|null
getCollectionParentIDFromChildID(int $cID)

Get the parent cID of a page given its cID.

int[]
getCollectionParentIDs()

Get an array containint this cParentID and aliased parentIDs.

bool|int|null
isMasterCollection()

Is this page a page default?

bool|int|null
overrideTemplatePermissions()

Are template permissions overriden?

int|null
getCollectionDisplayOrder()

Get the position of the page in the sitemap, relative to its parent page.

setTheme(Theme $pl)

Set the theme of this page.

setPageType(Type $type = null)

Set the theme for a page using the page object.

setPermissionsInheritanceToTemplate()

Set the permissions of sub-collections added beneath this permissions to inherit from the template.

setPermissionsInheritanceToOverride()

Set the permissions of sub-collections added beneath this permissions to inherit from the parent.

int|null
getPermissionsCollectionID()

Get the ID of the page from which this page inherits permissions from.

string|null
getCollectionInheritance()

Where permissions should be inherited from? 'PARENT' or 'TEMPLATE' or 'OVERRIDE'.

int|null
getParentPermissionsCollectionID()

Get the ID of the page from which the parent page page inherits permissions from.

getPermissionsCollectionObject()

Get the page from which this page inherits permissions from.

int
getMasterCollectionID()

Get the master page of this page, given its page template and page type.

int|null
getOriginalCollectionID()

Get the ID of the original collection.

int|null
getNumChildren()

Get the number of child pages.

int
getNumChildrenDirect()

Get the number of child pages (direct children only).

Page|false
getFirstChild(string $sortColumn = 'cDisplayOrder asc')

Get the first child of the current page, or null if there is no child.

int[]
getCollectionChildrenArray(bool $oneLevelOnly = 0)

Get the list of child page IDs, sorted by their display order.

Page[]
getCollectionChildren()

Get the immediate children of the this page.

_getNumChildren(int $cID, bool $oneLevelOnly = 0, string $sortColumn = 'cDisplayOrder asc')

Populate the childrenCIDArray property (called by the getCollectionChildrenArray() method).

bool
canMoveCopyTo(Collection $cobj)

Check if a collection is this page itself or one of its sub-pages.

updateCollectionName(string $name)

Update the collection name.

bool
hasPageThemeCustomizations()

Does this page have theme customizations?

resetCustomThemeStyles()

Clears the custom theme styles for this page.

setCustomStyleObject(Theme $pt, ValueList $valueList, Preset|null|false $selectedPreset = false, CustomCssRecord $customCssRecord = null)

Set the custom style for this page for a specific theme.

string
getPageWrapperClass()

Get the CSS class to be used to wrap the whole page contents.

writePageThemeCustomizations()

Write the page theme customization CSS files to the cache directory.

static 
resetAllCustomStyles()

Clears the custom theme styles for every page.

update(array $data)

Update the data of this page.

clearPagePermissions()

Clear all the page permissions.

inheritPermissionsFromParent()

Set this page permissions to be inherited from its parent page.

inheritPermissionsFromDefaults()

Set this page permissions to be inherited from its parent type defaults.

setPermissionsToManualOverride()

Set this page permissions to be manually specified.

rescanAreaPermissions()

Rescan the page areas ensuring that they are inheriting permissions properly.

setOverrideTemplatePermissions(bool|int $cOverrideTemplatePermissions)

Are template permissions overriden?

updatePermissionsCollectionID(int|string $cParentIDString, $npID)

Set the child pages of a list of parent pages to inherit permissions from the specified page (provided that they previouly had the same inheritance page as this page).

acquireAreaPermissions(int $permissionsCollectionID)

Acquire the area permissions, copying them from the inherited ones.

acquirePagePermissions(int $permissionsCollectionID)

Acquire the page permissions, copying them from the inherited ones.

__destruct()

No description

updateGroupsSubCollection(int|string $cParentIDString) deprecated

No description

addBlock(BlockType $bt, Area $a, array $data)

Add a new block to a specific area of the page.

getPageRelations()

Get the relations of this page.

move($nc)

Move this page under a new parent page.

duplicateAll($nc = null, bool $preserveUserID = false, Site $site = null)

Duplicate this page and all its child pages and return the new Page created.

_duplicateAll($cParent, $cNewParent, bool $preserveUserID = false, Site $site = null)

Duplicate all the child pages of a specific page which has already have been duplicated.

duplicate($nc = null, bool $preserveUserID = false, TreeInterface $site = null)

Duplicate this page and return the new Page created.

null|false
delete()

Delete this page and all its child pages.

moveToTrash()

Move this page and all its child pages to the trash.

rescanChildrenDisplayOrder()

Regenerate the display order of the child pages.

bool
isHomePage()

Is this the homepage for the site tree this page belongs to?

int|null
getSiteHomePageID()

Get the ID of the homepage for the site tree this page belongs to.

bool
isLocaleHomePage() deprecated

No description

static int|null
getHomePageID(Page|int $page = null)

Get the ID of the home page.

getAutoGeneratedPagePathObject()

Get a new PagePath object with the computed canonical page path.

int
getNextSubPageDisplayOrder()

Get the next available display order of child pages.

string
generatePagePath()

Get the URL-slug-based path to the current page (including any suffixes) in a string format. Does so in real time.

rescanCollectionPath()

Recalculate the canonical page path for the current page and its sub-pages, based on its current version, URL slug, etc.

string
computeCanonicalPagePath()

Get the canonical path string of this page .

updateDisplayOrder(int $displayOrder, int|null $cID = 0)

Set a new display order for this page (or for another page given its ID).

movePageDisplayOrderToTop()

Make this page the first child of its parent.

movePageDisplayOrderToBottom()

Make this page the first child of its parent.

movePageDisplayOrderToSibling(Page $c, string $position = 'before')

Move this page before of after another page.

rescanSystemPageStatus()

Recalculate the "is a system page" state.

bool
isInTrash()

Is this page in the trash?

moveToRoot()

Make this page child of nothing, thus moving it to the root level.

deactivate()

Mark this page as non active.

setPageToDraft()

Mark this page as non draft.

activate()

Mark this page as active.

bool
isActive()

Is this page marked as active?

setPageIndexScore(float $score)

Set the page index score (used by a PageList for instance).

float
getPageIndexScore()

Get the page index score (as set by a PageList for instance).

string
getPageIndexContent()

Get the indexed content of this page.

_associateMasterCollectionBlocks(int $newCID, $masterCID, bool $cAcquireComposerOutputControls)

Duplicate the master collection blocks/permissions to a newly created page.

_associateMasterCollectionAttributes(int $newCID, $masterCID)

Duplicate the master collection attributes to a newly created page.

static Page
addHomePage(TreeInterface $siteTree = null)

Add the home page to the system. Typically used only by the installation program.

add($pt, array $data, $template = false)

Add a new page, child of this page.

acquireAreaStylesFromDefaults(Template $template)

Copy the area styles from a page template.

getCustomStyleObject()

Get the custom style for the currently loaded page version (if any).

int|null
getCollectionFullPageCaching()

Get the full-page cache flag (-1: use global setting; 0: no; 1: yes - NULL if page is not loaded).

string|null
getCollectionFullPageCachingLifetime()

Get the full-page cache lifetime criteria ('default': use default lifetime; 'forever': no expiration; 'custom': custom lifetime value - see getCollectionFullPageCachingLifetimeCustomValue(); other: use the default lifetime - NULL if page is not loaded).

int|null
getCollectionFullPageCachingLifetimeCustomValue()

Get the full-page cache custom lifetime in minutes (to be used if getCollectionFullPageCachingLifetime() is 'custom').

int
getCollectionFullPageCachingLifetimeValue()

Get the actual full-page cache lifespan (in seconds).

static Page
addStatic(array $data, TreeInterface $parent = null)

Create a new page.

static Page|null
getCurrentPage()

Get the currently requested page.

int
getPageDraftTargetParentPageID()

Get the ID of the draft parent page ID.

setPageDraftTargetParentPageID(int $cParentID)

Set the ID of the draft parent page ID.

Details

assignPermissions($userOrGroup, $permissions = [], $accessType = Key::ACCESS_TYPE_INCLUDE, $cascadeToChildren = true)

No description

Parameters

$userOrGroup
$permissions
$accessType
$cascadeToChildren

static Page getByPath(string $path, string $version = 'RECENT', TreeInterface $tree = null)

Get a page given its path.

Parameters

string $path

the page path (example: /path/to/page)

string $version

the page version ('RECENT' for the most recent version, 'ACTIVE' for the currently published version, 'SCHEDULED' for the currently scheduled version, or an integer to retrieve a specific version ID)

TreeInterface $tree

Return Value

Page

CategoryInterface getObjectAttributeCategory()

static Page getByID(int $cID, string $version = 'RECENT')

  • Get a page given its ID.

Parameters

int $cID

the ID of the page

string $version

the page version ('RECENT' for the most recent version, 'ACTIVE' for the currently published version, 'SCHEDULED' for the currently scheduled version, or an integer to retrieve a specific version ID)

Return Value

Page

__construct()

Initialize collection until we populate it.

ItemInterface getExporter()

No description

protected populatePage(mixed $cInfo, string $where, string|int $cvID)

Read the data from the database.

Parameters

mixed $cInfo

The argument of the $where condition

string $where

The SQL 'WHERE' part

string|int $cvID

getPermissionResponseClassName()

getPermissionAssignmentClassName()

getPermissionObjectKeyCategoryHandle()

stdClass getJSONObject()

Return a representation of the Page object as something easily serializable.

Return Value

stdClass

PageController getPageController()

Get the page controller.

Return Value

PageController

getPermissionObjectIdentifier()

bool isEditMode()

Is the page in edit mode?

Return Value

bool

int getPackageID()

Get the package ID for a page (page thats added by a package) (returns 0 if its not in a package).

Return Value

int

string|null getPackageHandle()

Get the handle the the package that added this page.

Return Value

string|null

false isArrangeMode() deprecated

deprecated There's no more an "Arrange Mode"

No description

Return Value

false

forceCheckIn()

Forces the page to be checked in if its checked out.

static private forceCheckInForAllPages()

No description

bool isAdminArea()

Is this a dashboard page?

Return Value

bool

static Page getFromRequest(Request $request)

Uses a Request object to determine which page to load. Queries by path and then by cID.

Parameters

Request $request

Return Value

Page

processArrangement(int $area_id, int $moved_block_id, int[] $block_order)

Persist the data associated to a block when it has been moved around in the page.

Parameters

int $area_id

The ID of the area where the block resides after the arrangment

int $moved_block_id

The ID of the moved block

int[] $block_order

The IDs of all the blocks in the area, ordered by their display order

bool|null isCheckedOut()

Is the page checked out?

Return Value

bool|null

returns NULL if the page does not exist, a boolean otherwise

string getCollectionCheckedOutUserName()

Gets the user that is editing the current page.

Return Value

string

bool isCheckedOutByMe()

Checks if the page is checked out by the current user.

Return Value

bool

bool isGeneratedCollection()

Checks if the page is a single page.

Generated collections are collections without templates, that have special cFilename attributes .

Return Value

bool

setPermissionsToOverride()

setChildPermissionsToOverride()

removePermissions(Group|Group[]|User|UserInfo|User $userOrGroup, string[] $permissions = [])

Remove specific permission keys for a specific access entity (user, group, group combination).

Parameters

Group|Group[]|User|UserInfo|User $userOrGroup

A list of groups for a group combination, or a group or a user

string[] $permissions

the handles of page permission keys to be removed

static Page getDraftsParentPage(Site $site = null)

Get the drafts parent page for a specific site.

Parameters

Site $site

If not specified, we'll use the default site

Return Value

Page

static Page[] getDrafts(Site $site)

Get the list of draft pages in a specific site.

Parameters

Site $site

Return Value

Page[]

bool isPageDraft()

Is this a draft page?

Return Value

bool

static private string[] translatePermissionsXMLToKeys(SimpleXMLElement $node)

No description

Parameters

SimpleXMLElement $node

Return Value

string[]

setController(PageController|null $controller)

Set the page controller.

Parameters

PageController|null $controller

PageController getController() deprecated

deprecated use the getPageController() method

No description

Return Value

PageController

private assignPermissionSet(SimpleXMLElement $px)

This is the legacy function that is called just by xml. We pass these values in as though they were the old ones.

Parameters

SimpleXMLElement $px

int addCollectionAlias($c)

Make an alias to a page.

Parameters

$c

Return Value

int

The ID of the new collection

updateCollectionAliasExternal(string $cName, string $cLink, bool $newWindow = 0)

Update the name, link, and to open in a new window for an external link.

Parameters

string $cName
string $cLink
bool $newWindow

int addCollectionAliasExternal(string $cName, string $cLink, bool $newWindow = 0)

Add a new external link as a child of this page.

Parameters

string $cName
string $cLink
bool $newWindow

Return Value

int

The ID of the new collection

bool isSystemPage()

Returns true if a page is a system page. A system page is either a page that is outside the site tree (has a site tree ID of 0) or a page that is in the site tree, but whose parent starts at 0. That means its a root level page. Why do we need this separate boolean then? Because we need to easily be able to filter all pages by whether they're a system page even if we don't necessarily know where their starting page is.

Return Value

bool

string getCollectionIcon()

Gets the icon for a page (also fires the on_page_get_icon event).

Return Value

string

The path to the icon

int|null removeThisAlias()

Remove an external link/alias.

Return Value

int|null

cID of the original page if the page was an alias

array populateRecursivePages(array $pages, array $pageRow, int $cParentID, int $level, bool $includeThisPage = true)

Create an array containing data about child pages.

Parameters

array $pages

the previously loaded data

array $pageRow

The data of current parent page (it must contain cID and optionally cDisplayOrder)

int $cParentID

The parent page ID

int $level

The current depth level

bool $includeThisPage

Should $pageRow itself be added to the resulting array?

Return Value

array

Every array item contains the following keys: { @var int $cID @var int $cDisplayOrder @var int $cParentID @var int $level @var int $total }

int queueForDeletionSort(array $a, array $b)

Sort a list of pages, so that the order is correct for the deletion.

Parameters

array $a
array $b

Return Value

int

int queueForDuplicationSort(array $a, array $b)

Sort a list of pages, so that the order is correct for the duplication.

Parameters

array $a
array $b

Return Value

int

queueForDeletion()

Add this page and its subpages to the Delete Page queue.

queueForDeletionRequest(Queue|null $queue = null, bool $includeThisPage = true)

Add this page and its subpages to the Delete Page Requests queue (or to a custom queue).

Parameters

Queue|null $queue

the custom queue to add the pages to

bool $includeThisPage

Include this page itself in the page to be added to the queue?

queueForDuplication(Page $destination, bool $includeParent = true)

Add this page and its subpages to the Copy Page queue.

Parameters

Page $destination

the destination parent page where the pages will be copied to

bool $includeParent

Include this page itself in the page to be added to the queue?

export(SimpleXMLElement $pageNode) deprecated

deprecated use the \Concrete\Core\Page\Exporter class

No description

Parameters

SimpleXMLElement $pageNode

See also

Page::getExporter

int|null getCollectionCheckedOutUserID()

Get the uID for a page that is checked out (if any).

Return Value

int|null

string getCollectionPath()

Get the path of this page.

Return Value

string

PagePath|null getCollectionPathObject()

Returns the PagePath object for the current page.

Return Value

PagePath|null

PagePath addAdditionalPagePath(string $cPath, bool $commit = true)

Add a non-canonical page path to the current page.

Parameters

string $cPath
bool $commit

Should the new PagePath instance be persisted?

Return Value

PagePath

setCanonicalPagePath(string $cPath, bool $isAutoGenerated = false)

Set the canonical page path for a page.

Parameters

string $cPath
bool $isAutoGenerated

is the page path generated from URL slugs?

PagePath[] getPagePaths()

Get all the page paths of this page.

Return Value

PagePath[]

PagePath[] getAdditionalPagePaths()

Get all the non-canonical page paths of this page.

Return Value

PagePath[]

clearPagePaths()

Clears all page paths for a page.

Returns full url for the current page.

Parameters

bool $appendBaseURL

UNUSED

Return Value

string

int|null getSiteTreeID()

No description

Return Value

int|null

See also

TreeInterface::getSiteTreeID

Site getSite()

No description

Return Value

Site

See also

SiteAggregateInterface::getSite

Tree|null getSiteTreeObject()

No description

Return Value

Tree|null

See also

TreeInterface::getSiteTreeObject

static getCollectionPathFromID($cID)

Returns the path for a page from its cID.

Parameters

$cID

int|null getCollectionUserID()

Get the uID of the page author (if any).

Return Value

int|null

string getCollectionHandle()

Get the page handle.

Return Value

string

string|null getCollectionTypeName() deprecated

deprecated use the getPageTypeName() method

No description

Return Value

string|null

string|null getPageTypeName()

Get the display name of the page type (if available).

Return Value

string|null

getCollectionTypeID() deprecated

deprecated use the getPageTypeID() method

No description

int|null getPageTypeID()

Get the Collection Type ID.

Return Value

int|null

Type|null getPageTypeObject()

Get the page type object.

Return Value

Type|null

int getPageTemplateID()

Get the Page Template ID.

Return Value

int

Template|null getPageTemplateObject()

Get the Page Template Object (if available).

Return Value

Template|null

string|false getPageTemplateHandle()

Get the handle of the Page Template (if available).

Return Value

string|false

string|false getPageTypeHandle()

Get the handle of the Page Type (if available).

Return Value

string|false

string|false getCollectionTypeHandle() deprecated

deprecated use the getPageTypeHandle() method

No description

Return Value

string|false

int|null getCollectionThemeID()

Get the theme ID for the collection (if available).

Return Value

int|null

bool isBlockAliasedFromMasterCollection(Block $b)

Check if a block is an alias from a page default.

Parameters

Block $b

Return Value

bool

Theme getCollectionThemeObject()

Get the collection's theme object.

Return Value

Theme

string getCollectionName()

Get the page name.

Return Value

string

int getCollectionPointerID()

Get the collection ID for the aliased page (returns 0 unless used on an actual alias).

Return Value

int

Get the link for the aliased page.

Return Value

string|null

bool|int|null openCollectionPointerExternalLinkInNewWindow()

Should the alias link to be opened in a new window?

Return Value

bool|int|null

bool isAliasPage()

Since: concrete5 8.5.0a2

Is this page an alias page of another page?

Return Value

bool
Since: concrete5 8.5.0a2

Is this page an alias page or an external link?

Return Value

bool

bool isAlias() deprecated

deprecated This method has been replaced with isAliasPageOrExternalLink() in concrete5 8.5.0a2 (same syntax and same result)

No description

Return Value

bool

Is this page an external link?

Return Value

bool

int getCollectionPointerOriginalID()

Get the original cID of a page (if it's a page alias).

Return Value

int

string getCollectionFilename()

Get the file name of a page (single pages).

Return Value

string

string getCollectionDatePublic()

Get the date/time when the current version was made public (or a falsy value if the current version doesn't have public date).

Return Value

string

Examples

2009-01-01 00:00:00

DateTime|null getCollectionDatePublicObject()

Get the date/time when the current version was made public (or NULL value if the current version doesn't have public date).

Return Value

DateTime|null

string getCollectionDescription()

Get the description of a page.

Return Value

string

int|null getCollectionParentID()

Ges the cID of the parent page.

Return Value

int|null

static int|null getCollectionParentIDFromChildID(int $cID)

Get the parent cID of a page given its cID.

Parameters

int $cID

Return Value

int|null

int[] getCollectionParentIDs()

Get an array containint this cParentID and aliased parentIDs.

Return Value

int[]

bool|int|null isMasterCollection()

Is this page a page default?

Return Value

bool|int|null

bool|int|null overrideTemplatePermissions()

Are template permissions overriden?

Return Value

bool|int|null

int|null getCollectionDisplayOrder()

Get the position of the page in the sitemap, relative to its parent page.

Return Value

int|null

setTheme(Theme $pl)

Set the theme of this page.

Parameters

Theme $pl

setPageType(Type $type = null)

Set the theme for a page using the page object.

Parameters

Type $type

setPermissionsInheritanceToTemplate()

Set the permissions of sub-collections added beneath this permissions to inherit from the template.

setPermissionsInheritanceToOverride()

Set the permissions of sub-collections added beneath this permissions to inherit from the parent.

int|null getPermissionsCollectionID()

Get the ID of the page from which this page inherits permissions from.

Return Value

int|null

string|null getCollectionInheritance()

Where permissions should be inherited from? 'PARENT' or 'TEMPLATE' or 'OVERRIDE'.

Return Value

string|null

int|null getParentPermissionsCollectionID()

Get the ID of the page from which the parent page page inherits permissions from.

Return Value

int|null

Page getPermissionsCollectionObject()

Get the page from which this page inherits permissions from.

Return Value

Page

int getMasterCollectionID()

Get the master page of this page, given its page template and page type.

Return Value

int

returns 0 if not found

int|null getOriginalCollectionID()

Get the ID of the original collection.

Return Value

int|null

int|null getNumChildren()

Get the number of child pages.

Return Value

int|null

int getNumChildrenDirect()

Get the number of child pages (direct children only).

Return Value

int

Page|false getFirstChild(string $sortColumn = 'cDisplayOrder asc')

Get the first child of the current page, or null if there is no child.

Parameters

string $sortColumn

the ORDER BY clause

Return Value

Page|false

int[] getCollectionChildrenArray(bool $oneLevelOnly = 0)

Get the list of child page IDs, sorted by their display order.

Parameters

bool $oneLevelOnly

set to true to return only the direct children, false for all the child pages

Return Value

int[]

Page[] getCollectionChildren()

Get the immediate children of the this page.

Return Value

Page[]

protected _getNumChildren(int $cID, bool $oneLevelOnly = 0, string $sortColumn = 'cDisplayOrder asc')

Populate the childrenCIDArray property (called by the getCollectionChildrenArray() method).

Parameters

int $cID
bool $oneLevelOnly
string $sortColumn

bool canMoveCopyTo(Collection $cobj)

Check if a collection is this page itself or one of its sub-pages.

Parameters

Collection $cobj

Return Value

bool

updateCollectionName(string $name)

Update the collection name.

Parameters

string $name

bool hasPageThemeCustomizations()

Does this page have theme customizations?

Return Value

bool

resetCustomThemeStyles()

Clears the custom theme styles for this page.

CustomStyle setCustomStyleObject(Theme $pt, ValueList $valueList, Preset|null|false $selectedPreset = false, CustomCssRecord $customCssRecord = null)

Set the custom style for this page for a specific theme.

Parameters

Theme $pt
ValueList $valueList
Preset|null|false $selectedPreset
CustomCssRecord $customCssRecord

Return Value

CustomStyle

string getPageWrapperClass()

Get the CSS class to be used to wrap the whole page contents.

Return Value

string

writePageThemeCustomizations()

Write the page theme customization CSS files to the cache directory.

static resetAllCustomStyles()

Clears the custom theme styles for every page.

update(array $data)

Update the data of this page.

Parameters

array $data

Recognized keys are { @var string $cHandle @var string $cName @var string $cDescription @var string $cDatePublic @var int $ptID @var int $pTemplateID @var int $uID @var string $$cFilename @var int $cCacheFullPageContent -1: use the default settings; 0: no; 1: yes @var int $cCacheFullPageContentLifetimeCustom @var string $cCacheFullPageContentOverrideLifetime }

clearPagePermissions()

Clear all the page permissions.

inheritPermissionsFromParent()

Set this page permissions to be inherited from its parent page.

inheritPermissionsFromDefaults()

Set this page permissions to be inherited from its parent type defaults.

setPermissionsToManualOverride()

Set this page permissions to be manually specified.

rescanAreaPermissions()

Rescan the page areas ensuring that they are inheriting permissions properly.

setOverrideTemplatePermissions(bool|int $cOverrideTemplatePermissions)

Are template permissions overriden?

Parameters

bool|int $cOverrideTemplatePermissions

updatePermissionsCollectionID(int|string $cParentIDString, $npID)

Set the child pages of a list of parent pages to inherit permissions from the specified page (provided that they previouly had the same inheritance page as this page).

Parameters

int|string $cParentIDString

A comma-separeted list of parent page IDs

$npID

acquireAreaPermissions(int $permissionsCollectionID)

Acquire the area permissions, copying them from the inherited ones.

Parameters

int $permissionsCollectionID

the ID of the collection from which the page previously inherited permissions from

acquirePagePermissions(int $permissionsCollectionID)

Acquire the page permissions, copying them from the inherited ones.

Parameters

int $permissionsCollectionID

the ID of the collection from which the page previously inherited permissions from

__destruct()

No description

updateGroupsSubCollection(int|string $cParentIDString) deprecated

deprecated is this function still useful? There's no reference to it in the core

No description

Parameters

int|string $cParentIDString

Block addBlock(BlockType $bt, Area $a, array $data)

Add a new block to a specific area of the page.

Parameters

BlockType $bt

the type of block to be added

Area $a

the area instance (or its handle) to which the block should be added to

array $data

The data of the block. This data depends on the specific block type

Return Value

Block

SiblingRelation[] getPageRelations()

Get the relations of this page.

Return Value

SiblingRelation[]

move($nc)

Move this page under a new parent page.

Parameters

$nc

Page duplicateAll($nc = null, bool $preserveUserID = false, Site $site = null)

Duplicate this page and all its child pages and return the new Page created.

Parameters

$nc
bool $preserveUserID

Set to true to preserve the original page author IDs

Site $site

the destination site (used if $toParentPage is NULL)

Return Value

Page

protected _duplicateAll($cParent, $cNewParent, bool $preserveUserID = false, Site $site = null)

Duplicate all the child pages of a specific page which has already have been duplicated.

Parameters

$cParent
$cNewParent
bool $preserveUserID

Set to true to preserve the original page author IDs

Site $site

the destination site

Page duplicate($nc = null, bool $preserveUserID = false, TreeInterface $site = null)

Duplicate this page and return the new Page created.

Parameters

$nc
bool $preserveUserID

Set to true to preserve the original page author IDs

TreeInterface $site

the destination site (used if $toParentPage is NULL)

Return Value

Page

null|false delete()

Delete this page and all its child pages.

Return Value

null|false

return false if it's not possible to delete this page (for instance because it's the main homepage)

moveToTrash()

Move this page and all its child pages to the trash.

rescanChildrenDisplayOrder()

Regenerate the display order of the child pages.

bool isHomePage()

Is this the homepage for the site tree this page belongs to?

Return Value

bool

int|null getSiteHomePageID()

Get the ID of the homepage for the site tree this page belongs to.

Return Value

int|null

Returns NULL if there's no default locale

bool isLocaleHomePage() deprecated

deprecated use the isHomePage() method

No description

Return Value

bool

static int|null getHomePageID(Page|int $page = null)

Get the ID of the home page.

Parameters

Page|int $page

the page (or its ID) for which you want the home (if not specified, we'll use the default locale site tree)

Return Value

int|null

returns NULL if $page is null (or it doesn't have a SiteTree associated) and if there's no default locale

PagePath getAutoGeneratedPagePathObject()

Get a new PagePath object with the computed canonical page path.

Return Value

PagePath

int getNextSubPageDisplayOrder()

Get the next available display order of child pages.

Return Value

int

string generatePagePath()

Get the URL-slug-based path to the current page (including any suffixes) in a string format. Does so in real time.

Return Value

string

rescanCollectionPath()

Recalculate the canonical page path for the current page and its sub-pages, based on its current version, URL slug, etc.

protected string computeCanonicalPagePath()

Get the canonical path string of this page .

This happens before any uniqueness checks get run.

Return Value

string

updateDisplayOrder(int $displayOrder, int|null $cID = 0)

Set a new display order for this page (or for another page given its ID).

Parameters

int $displayOrder
int|null $cID

The page ID to set the display order for (if empty, we'll use this page)

movePageDisplayOrderToTop()

Make this page the first child of its parent.

movePageDisplayOrderToBottom()

Make this page the first child of its parent.

movePageDisplayOrderToSibling(Page $c, string $position = 'before')

Move this page before of after another page.

Parameters

Page $c
string $position

'before' or 'after'

rescanSystemPageStatus()

Recalculate the "is a system page" state.

Looks at the current page. If the site tree ID is 0, sets system page to true. If the site tree is not user, looks at where the page falls in the hierarchy. If it's inside a page at the top level that has 0 as its parent, then it is considered a system page.

bool isInTrash()

Is this page in the trash?

Return Value

bool

moveToRoot()

Make this page child of nothing, thus moving it to the root level.

deactivate()

Mark this page as non active.

setPageToDraft()

Mark this page as non draft.

activate()

Mark this page as active.

bool isActive()

Is this page marked as active?

Return Value

bool

setPageIndexScore(float $score)

Set the page index score (used by a PageList for instance).

Parameters

float $score

float getPageIndexScore()

Get the page index score (as set by a PageList for instance).

Return Value

float

string getPageIndexContent()

Get the indexed content of this page.

Return Value

string

protected _associateMasterCollectionBlocks(int $newCID, $masterCID, bool $cAcquireComposerOutputControls)

Duplicate the master collection blocks/permissions to a newly created page.

Parameters

int $newCID

the ID of the newly created page

$masterCID
bool $cAcquireComposerOutputControls

protected _associateMasterCollectionAttributes(int $newCID, $masterCID)

Duplicate the master collection attributes to a newly created page.

Parameters

int $newCID

the ID of the newly created page

$masterCID

static Page addHomePage(TreeInterface $siteTree = null)

Add the home page to the system. Typically used only by the installation program.

Parameters

TreeInterface $siteTree

Return Value

Page

Page add($pt, array $data, $template = false)

Add a new page, child of this page.

Parameters

$pt
array $data

Supported keys: { @var int|null $uID The ID of the page author (if unspecified or NULL: current user) @var int|null $pkgID the ID of the package that creates this page @var string $cName The page name @var string $name (used if cName is not specified) @var int|null $cID The ID of the page to create (if unspecified or NULL: database autoincrement value) @var int|bool $cIsActive Is the page to be considered as active? @var int|bool $cIsDraft Is the page to be considered as draft? @var string $cHandle The page handle @var string $cDescription The page description (default: NULL) @var string $cDatePublic The page publish date/time in format 'YYYY-MM-DD hh:mm:ss' (default: now) @var bool $cvIsApproved Is the page version approved (default: true) @var bool $cvIsNew Is the page to be considered "new"? (default: true if $cvIsApproved is false, false if $cvIsApproved is true) @var bool $cAcquireComposerOutputControls }

$template

Return Value

Page

protected acquireAreaStylesFromDefaults(Template $template)

Copy the area styles from a page template.

Parameters

Template $template

CustomStyle|null getCustomStyleObject()

Get the custom style for the currently loaded page version (if any).

Return Value

CustomStyle|null

int|null getCollectionFullPageCaching()

Get the full-page cache flag (-1: use global setting; 0: no; 1: yes - NULL if page is not loaded).

Return Value

int|null

string|null getCollectionFullPageCachingLifetime()

Get the full-page cache lifetime criteria ('default': use default lifetime; 'forever': no expiration; 'custom': custom lifetime value - see getCollectionFullPageCachingLifetimeCustomValue(); other: use the default lifetime - NULL if page is not loaded).

Return Value

string|null

int|null getCollectionFullPageCachingLifetimeCustomValue()

Get the full-page cache custom lifetime in minutes (to be used if getCollectionFullPageCachingLifetime() is 'custom').

Return Value

int|null

returns NULL if page is not loaded

int getCollectionFullPageCachingLifetimeValue()

Get the actual full-page cache lifespan (in seconds).

Return Value

int

static Page addStatic(array $data, TreeInterface $parent = null)

Create a new page.

Parameters

array $data

The data to be used to create the page. See Collection::createCollection() for the supported keys, plus 'pkgID' and 'filename'.

TreeInterface $parent

the parent page (or the site) that will contain the new page

Return Value

Page

See also

Collection::createCollection

static Page|null getCurrentPage()

Get the currently requested page.

Return Value

Page|null

int getPageDraftTargetParentPageID()

Get the ID of the draft parent page ID.

Return Value

int

setPageDraftTargetParentPageID(int $cParentID)

Set the ID of the draft parent page ID.

Parameters

int $cParentID