class Section extends Page (View source)

Traits

Properties

$error from  ConcreteObject
int|null deprecated $cID

The collection ID.

from  Collection
protected Version|null $vObj

The collection version object.

from  Collection
protected string|null $cHandle

The collection handle.

from  Collection
protected string|null $cDateAdded

The date/time when the collection has been created.

from  Collection
protected string|null $cDateModified

The date/time when the collection was last modified.

from  Collection
protected array $attributes from  Collection
Tree|null deprecated $siteTree from  Page
protected PageController|null $controller

The page controller.

from  Page
protected int[]|null $blocksAliasedFromMasterCollection

The list of block IDs that are alias.

from  Page
int|null $cCheckedOutUID

The user id of the user that has checked out the page.

from  Page
protected int|null $cPointerOriginalID

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

from  Page
protected int|null $cPointerOriginalSiteTreeID

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

from  Page
$cPointerExternalLink

The link for the aliased page.

from  Page
protected bool|int|null $cPointerExternalLinkNewWindow

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

from  Page
protected bool|int|null $isMasterCollection

Is this page a page default?

from  Page
protected int|null $cInheritPermissionsFromCID

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

from  Page
protected bool $cIsSystemPage

Is this a system page?

from  Page
protected int|null $siteTreeID

The site tree ID.

from  Page
int|null deprecated $pkgID from  Page
string|false|null deprecated $pkgHandle from  Page
int|null deprecated $cPointerID from  Page
int|bool|null deprecated $cIsDraft from  Page
int|bool|null deprecated $cIsActive from  Page
string|null deprecated $cFilename from  Page
int|null deprecated $ptID from  Page
int|null deprecated $cDisplayOrder from  Page
string|null deprecated $cInheritPermissionsFrom from  Page
bool|int|null deprecated $cOverrideTemplatePermissions from  Page
int|bool|null deprecated $cIsTemplate from  Page
int|null deprecated $uID from  Page
string|null deprecated $cPath from  Page
int|null deprecated $cParentID from  Page
int|null deprecated $cChildren from  Page
int|null deprecated $cCacheFullPageContent from  Page
private string|null $customAliasName

The custom name of the alias page.

from  Page
private string|null $aliasHandle

The handle of the alias page

from  Page
protected bool|null $hasCustomSummaryTemplateCollection

Whether this page has a custom summary template collection assigned to it. If null/false, then we just use any that are found to fit the criteria.

from  Page
protected $cCacheFullPageContentOverrideLifetime from  Page
protected $cCacheFullPageContentLifetimeCustom from  Page
protected Locale $locale

Methods

loadError($error)

No description

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

static 
camelcase($file)

No description

static 
uncamelcase($string)

No description

__destruct()

Destruct the class instance.

static Collection
getByID(int $cID, int|string $cvID = 'RECENT')

Returns an instance of MultilingualSection for the given page ID.

static Collection|null
getByHandle(string $handle)

Get a Collection by handle (provided that it's not a Page handle).

static int
reindexPendingPages()

(Re)Index all the collections that are marked as to be (re)indexed.

static Collection
createCollection(array $data)

Create a new Collection instance.

int|null
getCollectionID()

Get the collection ID.

string|null
getCollectionHandle()

Get the collection handle.

from  Page
string|null
getCollectionDateLastModified()

Get the date/time when the collection was last modified.

string|null
getCollectionDateAdded()

Get the date/time when the collection has been created.

int
getVersionID()

Get the ID of the currently loaded version.

Version|null
getVersionObject()

Get the currently loaded version object.

addCollection(array $data)

Create a new Collection instance, using the same theme as this instance (if it's a Page instance).

loadVersionObject(string|int $cvID = 'ACTIVE')

Load a specific collection version (you can retrieve it with the getVersionObject() method).

$this|Page
getVersionToModify()

Get the Collection instance to be modified (this instance if it's a new or master Collection, a clone otherwise).

string
getNextVersionComments()

Get the automatic comment for the next collection version.

reindex($doReindexImmediately = true)

No description

setAttribute(string|CollectionKey $ak, AbstractValue|mixed $value, bool $doReindexImmediately = true)

Set the attribute value for the currently loaded collection version.

mixed|null
getAttribute(string|CollectionKey $akHandle, string|false $displayMode = false)

Return the value of the attribute with the handle $akHandle of the currently loaded version (if it's loaded).

PageValue|null
getAttributeValueObject(string|CollectionKey $akHandle, bool $createIfNotExists = false)

Return the attribute value object with the handle $akHandle of the currently loaded version (if it's loaded).

clearCollectionAttributes(int[] $retainAKIDs = [])

Delete the values of the attributes associated to the currently loaded collection version.

clearAttribute(string|CollectionKey $ak, bool $doReindexImmediately = true)

Delete the value of a specific attribute key associated to the currently loaded collection version.

getSetCollectionAttributes()

Get the list of attribute keys for which the currently loaded collection version has values.

Area|null
getArea(string $arHandle)

Get an existing area associated to this collection.

bool
hasAliasedContent()

Does this collection contain blocks that are aliased in other pages?

getAreaCustomStyle(Area $area, bool $force = false)

Get the custom style of an area in the currently loaded collection version.

setCustomStyleSet(Area $area, StyleSet $set)

Set the custom style of an area in the currently loaded collection version.

resetAreaCustomStyle(Area $area)

Delete all the custom styles of an area of the currently loaded collection version.

string|null
outputCustomStyleHeaderItems(bool $return = false)

Retrieve all custom style rules that should be inserted into the header on a page, whether they are defined in areas or blocks.

null|false
relateVersionEdits(Collection $oc)

Associate the edits of another collection to this collection.

int|false
getPageTypeID()

Returns the ID of the page/collection type.

from  Page
refreshCache()

Empty the collection-related cache.

Block[]
getGlobalBlocks()

Get the blocks contained in all the global areas in this collection.

array
getGlobalBlockIDs()

Get the IDs for blocks contained in all the global areas in this collection.

Stack[]
getGlobalStacksForCollection()

Get all the global stacks loaded in this collection.

Block[]
getBlocks(string|false $arHandle = false)

List the blocks in the currently loaded collection version (or in a specific area within it).

array
getBlockIDs(string|false $arHandle = false)

List the block IDs and the associated area handles in the currently loaded collection version (or in a specific area within it).

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

Add a new block to a specific area of the currently loaded collection version.

from  Page
int
getCollectionAreaDisplayOrder(string $arHandle, bool $ignoreVersions = false)

Get the next value of the display order (to be used when adding new blocks to an area).

rescanDisplayOrder(string $arHandle)

Fix the display order properties for all the blocks within the collection/area.

void
rescanDisplayOrderFromBlock(Block $block, string $arHandle, int $fromDisplay = null)

Fix the display order properties for all the blocks after this block in this area.

markModified()

Update the last edit date/time.

delete()

Delete this collection, and all its versions, contents and attributes.

from  Page
duplicateCollection()

Create a clone of this collection, and all its versions, contents and attributes.

cloneVersion(string|null $versionComments, bool $createEmpty = false)

Clone the currently loaded version and returns a Page instance containing the new version.

PageValue|null
getAttributeValue(string|CollectionKey $ak) deprecated

No description

mixed|null
getCollectionAttributeValue(string|CollectionKey $akHandle) deprecated

No description

getCollectionTypeID() deprecated

No description

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

No description

__construct()

Initialize collection until we populate it.

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

Get a page given its path.

from  Page
getExporter()

No description

from  Page
from  Page
string
getSummaryCategoryHandle()

No description

from  Page
getSummaryIdentifier()

No description

from  Page
getJSONObject()

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

from  Page
getPageController()

Get the page controller.

from  Page
from  Page
bool
isEditMode()

Is the page in edit mode?

from  Page
int
getPackageID()

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

from  Page
string|null
getPackageHandle()

Get the handle the the package that added this page.

from  Page
false
isArrangeMode() deprecated

No description

from  Page
forceCheckIn()

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

from  Page
static 
forceCheckInForAllPages()

No description

from  Page
bool
isAdminArea()

Is this a dashboard page?

from  Page
static Page
getFromRequest(Request $request)

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

from  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.

from  Page
bool|null
isCheckedOut()

Is the page checked out?

from  Page
string
getCollectionCheckedOutUserName()

Gets the user that is editing the current page.

from  Page
bool
isCheckedOutByMe()

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

from  Page
bool
isGeneratedCollection()

Checks if the page is a single page.

from  Page
setPermissionsToOverride()

No description

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

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

from  Page
static Page
getDraftsParentPage(Site $site = null)

Get the drafts parent page for a specific site.

from  Page
static Page[]
getDrafts(Site $site)

Get the list of draft pages in a specific site.

from  Page
bool
isPageDraft()

Is this a draft page?

from  Page
setController(PageController|null $controller)

Set the page controller.

from  Page
getController() deprecated

No description

from  Page
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.

from  Page
array
getSummaryTemplates()

No description

from  Page
bool
hasCustomSummaryTemplates()

No description

from  Page
array
from  Page
int
addCollectionAlias(mixed $c)

Make an alias to a page.

from  Page
void
updateCollectionAlias(array $data)

Update the alias details.

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

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

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

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

from  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.

from  Page
string
getCollectionIcon()

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

from  Page
int|null
removeThisAlias()

Remove an external link/alias.

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

Create an array containing data about child pages.

from  Page
static int
queueForDeletionSort(array $a, array $b)

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

from  Page
static int
queueForDuplicationSort(array $a, array $b)

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

from  Page
export(SimpleXMLElement $pageNode) deprecated

No description

from  Page
int|null
getCollectionCheckedOutUserID()

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

from  Page
string
getCollectionPath()

Get the path of this page.

from  Page
PagePath|null
getCollectionPathObject()

Returns the PagePath object for the current page.

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

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

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

Set the canonical page path for a page.

from  Page
getPagePaths()

Get all the page paths of this page.

from  Page
getAdditionalPagePaths()

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

from  Page
clearPagePaths()

Clears all page paths for a page.

from  Page
string
getCollectionLink()

Returns full url for the current page.

from  Page
int|null
getSiteTreeID()

No description

from  Page
getSite()

No description

from  Page
Tree|null
getSiteTreeObject()

No description

from  Page
static 
getCollectionPathFromID(mixed $cID)

Returns the path for a page from its cID.

from  Page
int|null
getCollectionUserID()

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

from  Page
string|null
getCollectionTypeName() deprecated

No description

from  Page
string|null
getPageTypeName()

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

from  Page
Type|null
getPageTypeObject()

Get the page type object.

from  Page
int
getPageTemplateID()

Get the Page Template ID.

from  Page
Template|null
getPageTemplateObject()

Get the Page Template Object (if available).

from  Page
string|false
getPageTemplateHandle()

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

from  Page
string|false
getPageTypeHandle()

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

from  Page
string|false
getCollectionTypeHandle() deprecated

No description

from  Page
int|null
getCollectionThemeID()

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

from  Page
bool
isBlockAliasedFromMasterCollection(Block $b)

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

from  Page
getCollectionThemeObject()

Get the collection's theme object.

from  Page
string
getCollectionName()

Get the page name.

from  Page
string|null
getCustomAliasName()

Get the custom name of the alias page.

from  Page
string|null
getAliasHandle()

Get the handle of the alias page

from  Page
int
getCollectionPointerID()

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

from  Page
string|null
getCollectionPointerExternalLink()

Get the link for the aliased page.

from  Page
bool|int|null
openCollectionPointerExternalLinkInNewWindow()

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

from  Page
bool
isAliasPage()

Is this page an alias page of another page?

from  Page
bool
isAliasPageOrExternalLink()

Is this page an alias page or an external link?

from  Page
bool
isAlias() deprecated

No description

from  Page
bool
isExternalLink()

Is this page an external link?

from  Page
int
getCollectionPointerOriginalID()

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

from  Page
string
getCollectionFilename()

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

from  Page
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).

from  Page
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).

from  Page
string
getCollectionDescription()

Get the description of a page.

from  Page
int|null
getCollectionParentID()

Ges the cID of the parent page.

from  Page
static int|null
getCollectionParentIDFromChildID(int $cID)

Get the parent cID of a page given its cID.

from  Page
int[]
getCollectionParentIDs()

Get an array containint this cParentID and aliased parentIDs.

from  Page
bool|int|null
isMasterCollection()

Is this page a page default?

from  Page
bool|int|null
overrideTemplatePermissions()

Are template permissions overriden?

from  Page
int|null
getCollectionDisplayOrder()

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

from  Page
setTheme(Theme $pl)

Set the theme of this page.

from  Page
setThemeSkin(SkinInterface $skin)

Set the theme skin of this page.

from  Page
setPageType(Type $type = null)

Set the theme for a page using the page object.

from  Page
setPermissionsInheritanceToTemplate()

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

from  Page
setPermissionsInheritanceToOverride()

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

from  Page
int|null
getPermissionsCollectionID()

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

from  Page
string|null
getCollectionInheritance()

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

from  Page
int|null
getParentPermissionsCollectionID()

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

from  Page
getPermissionsCollectionObject()

Get the page from which this page inherits permissions from.

from  Page
int
getMasterCollectionID()

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

from  Page
int|null
getOriginalCollectionID()

Get the ID of the original collection.

from  Page
int|null
getNumChildren()

Get the number of child pages.

from  Page
int
getNumChildrenDirect()

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

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

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

from  Page
int[]
getCollectionChildrenArray(bool $oneLevelOnly = 0)

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

from  Page
Page[]
getCollectionChildren()

Get the immediate children of the this page.

from  Page
bool
canMoveCopyTo(Collection $cobj)

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

from  Page
updateCollectionName(string $name)

Update the collection name.

from  Page
bool
hasPageThemeCustomizations()

Does this page have theme customizations?

from  Page
string
getPageWrapperClass()

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

from  Page
update(array $data)

Update the data of this page.

from  Page
clearPagePermissions()

Clear all the page permissions.

from  Page
inheritPermissionsFromParent()

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

from  Page
inheritPermissionsFromDefaults()

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

from  Page
setPermissionsToManualOverride()

Set this page permissions to be manually specified.

from  Page
rescanAreaPermissions()

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

from  Page
setOverrideTemplatePermissions(bool|int $cOverrideTemplatePermissions)

Are template permissions overriden?

from  Page
updatePermissionsCollectionID(int|string $cParentIDString, mixed $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).

from  Page
acquireAreaPermissions(int $permissionsCollectionID)

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

from  Page
acquirePagePermissions(int $permissionsCollectionID)

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

from  Page
updateGroupsSubCollection(int|string $cParentIDString) deprecated

No description

from  Page
getPageRelations()

Get the relations of this page.

from  Page
move(mixed $nc)

Move this page under a new parent page.

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

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

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

Duplicate this page and return the new Page created.

from  Page
moveToTrash()

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

from  Page
rescanChildrenDisplayOrder()

Regenerate the display order of the child pages.

from  Page
bool
isHomePage()

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

from  Page
int|null
getSiteHomePageID()

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

from  Page
bool
isLocaleHomePage() deprecated

No description

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

Get the ID of the home page.

from  Page
getAutoGeneratedPagePathObject()

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

from  Page
int
getNextSubPageDisplayOrder()

Get the next available display order of child pages.

from  Page
string
generatePagePath()

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

from  Page
rescanCollectionPath()

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

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

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

from  Page
movePageDisplayOrderToTop()

Make this page the first child of its parent.

from  Page
movePageDisplayOrderToBottom()

Make this page the first child of its parent.

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

Move this page before of after another page.

from  Page
rescanSystemPageStatus()

Recalculate the "is a system page" state.

from  Page
bool
isInTrash()

Is this page in the trash?

from  Page
moveToRoot()

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

from  Page
deactivate()

Mark this page as non active.

from  Page
setPageToDraft()

Mark this page as non draft.

from  Page
activate()

Mark this page as active.

from  Page
bool
isActive()

Is this page marked as active?

from  Page
setPageIndexScore(float $score)

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

from  Page
float
getPageIndexScore()

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

from  Page
string
getPageIndexContent()

Get the indexed content of this page.

from  Page
static Page
addHomePage(TreeInterface $siteTree = null)

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

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

Add a new page, child of this page.

from  Page
getCustomStyleObject()

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

from  Page
int|null
getCollectionFullPageCaching()

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

from  Page
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).

from  Page
int|null
getCollectionFullPageCachingLifetimeCustomValue()

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

from  Page
int
getCollectionFullPageCachingLifetimeValue()

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

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

Create a new page.

from  Page
static Page|null
getCurrentPage()

Get the currently requested page.

from  Page
int
getPageDraftTargetParentPageID()

Get the ID of the draft parent page ID.

from  Page
setPageDraftTargetParentPageID(int $cParentID)

Set the ID of the draft parent page ID.

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

Read the data from the database.

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

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

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

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

from  Page
getPageSkin()

No description

from  Page
string
computeCanonicalPagePath()

Get the canonical path string of this page .

from  Page
_associateMasterCollectionBlocks(int $newCID, mixed $masterCID, bool $cAcquireComposerOutputControls)

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

from  Page
_associateMasterCollectionAttributes(int $newCID, mixed $masterCID)

Duplicate the master collection attributes to a newly created page.

from  Page
acquireAreaStylesFromDefaults(Template $template)

Copy the area styles from a page template.

from  Page
static string[]
from  Page
static 
isMultilingualSection($cID)

No description

static 
getLocaleFromHomePageID($cID)

No description

setLocale($locale)

No description

static Section
getBySectionOfSite(Page $page)

No description

getLanguageText($locale = null)

No description

getLanguage()

No description

getIcon()

No description

getCountry()

No description

int
getNumberOfPluralForms()

Returns the number of plural forms.

string
getPluralsRule()

Returns the rule to determine which plural we should use (in gettext notation).

array
getPluralsCases()

Returns the plural cases for the language; array keys are the case name, array values are some examples for that case.

static 
getIDList(Site $site = null)

No description

static 
getList(Site $site = null)

No description

static 
getRelatedCollectionIDForLocale($cID, $locale)

No description

static 
getMultilingualPageRelationID($cID)

No description

static 
isAssigned($page)

No description

static 
getCollectionIDForLocale($mpRelationID, $locale)

No description

static 
registerDuplicate($newPage, $oldPage)

No description

static Section|false
getByLanguage(string $language, Site $site = null)

No description

static Section|false
getByLocale($locale, Site $site = null)

No description

static Section
getCurrentSection()

Gets the MultilingualSection object for the current section of the site.

static 
getByLocaleOrLanguage($locale)

No description

getLocaleObject()

No description

getLocale()

No description

static 
getDefaultSection(Site $site = null)

No description

static 
unregisterPage($page)

No description

static 
registerPage($page)

No description

static 
registerMove($page, $oldParent, $newParent)

No description

static 
relatePage($oldPage, $newPage, $locale)

No description

isDefaultMultilingualSection(Site $site = null)

No description

static 
ignorePageRelation($page, $locale)

No description

int|null
getTranslatedPageID($page)

Receives a page in a different language tree, and tries to return the corresponding page in the current language tree.

Translations
getSectionInterfaceTranslations(bool $untranslatedFirst = false)

Loads the translations of this multilingual section.

Details

loadError($error)

No description

Parameters

$error

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

Parameters

$arr

static camelcase($file)

No description

Parameters

$file

static uncamelcase($string)

No description

Parameters

$string

__destruct()

Destruct the class instance.

static Collection getByID(int $cID, int|string $cvID = 'RECENT')

Returns an instance of MultilingualSection for the given page ID.

Parameters

int $cID

The collection ID

int|string $cvID

Return Value

Collection

If the collection is not found, you'll get an empty Collection instance

static Collection|null getByHandle(string $handle)

Get a Collection by handle (provided that it's not a Page handle).

If there's there's no collection with the specified handle, a new Collection will be created.

Parameters

string $handle

the collection handle

Return Value

Collection|null

return NULL if $handle is the handle of an existing page

static int reindexPendingPages()

(Re)Index all the collections that are marked as to be (re)indexed.

Return Value

int

returns the number of reindexed pages

static Collection createCollection(array $data)

Create a new Collection instance.

Parameters

array $data

{

@var int|null $cID The ID of the collection to create (if unspecified or NULL: database autoincrement value)
@var string $handle The collection handle (default: NULL)
@var string $name The collection name (default: empty string)
@var string $cDescription The collection description (default: NULL)
@var string $cDatePublic The collection publish date/time in format 'YYYY-MM-DD hh:mm:ss' (default: now)
@var bool $cvIsApproved Is the collection version approved (default: true)
@var bool $cvIsNew Is the collection to be considered "new"? (default: true if $cvIsApproved is false, false if $cvIsApproved is true)
@var int|null $pThemeID The collection theme ID (default: NULL)
@var int|null $pTemplateID The collection template ID (default: NULL)
@var int|null $uID The ID of the collection author (default: NULL)

}

Return Value

Collection

int|null getCollectionID()

Get the collection ID.

Return Value

int|null

string|null getCollectionHandle()

Get the collection handle.

Return Value

string|null

string|null getCollectionDateLastModified()

Get the date/time when the collection was last modified.

Return Value

string|null

Examples

2017-12-31 23:59:59

string|null getCollectionDateAdded()

Get the date/time when the collection has been created.

Return Value

string|null

Examples

2017-12-31 23:59:59

int getVersionID()

Get the ID of the currently loaded version.

Return Value

int

Version|null getVersionObject()

Get the currently loaded version object.

Return Value

Version|null

Collection addCollection(array $data)

Create a new Collection instance, using the same theme as this instance (if it's a Page instance).

Parameters

array $data

{

@var int|null $cID The ID of the collection to create (if unspecified or NULL: database autoincrement value)
@var string $handle The collection handle (default: NULL)
@var string $name The collection name (default: empty string)
@var string $cDescription The collection description (default: NULL)
@var string $cDatePublic The collection publish date/time in format 'YYYY-MM-DD hh:mm:ss' (default: now)
@var bool $cvIsApproved Is the collection version approved (default: true)
@var bool $cvIsNew Is the collection to be considered "new"? (default: true if $cvIsApproved is false, false if $cvIsApproved is true)
@var int|null $pTemplateID The collection template ID (default: NULL)
@var int|null $uID The ID of the collection author (default: NULL)

}

Return Value

Collection

loadVersionObject(string|int $cvID = 'ACTIVE')

Load a specific collection version (you can retrieve it with the getVersionObject() method).

Parameters

string|int $cvID

the collection 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)

$this|Page getVersionToModify()

Get the Collection instance to be modified (this instance if it's a new or master Collection, a clone otherwise).

Return Value

$this|Page

string getNextVersionComments()

Get the automatic comment for the next collection version.

Return Value

string

Example: 'Version 2'

reindex($doReindexImmediately = true)

No description

Parameters

$doReindexImmediately

PageValue setAttribute(string|CollectionKey $ak, AbstractValue|mixed $value, bool $doReindexImmediately = true)

Set the attribute value for the currently loaded collection version.

Parameters

string|CollectionKey $ak

the attribute key (or its handle)

AbstractValue|mixed $value

an attribute value object, or the data needed by the attribute controller to create the attribute value object

bool $doReindexImmediately

Return Value

PageValue

mixed|null getAttribute(string|CollectionKey $akHandle, string|false $displayMode = false)

Return the value of the attribute with the handle $akHandle of the currently loaded version (if it's loaded).

Parameters

string|CollectionKey $akHandle

the attribute key (or its handle)

string|false $displayMode

makes The format of the attribute value

Return Value

mixed|null

Examples

When you need the raw attribute value or object, use this:
<code>
$c = Page::getCurrentPage();
$attributeValue = $c->getAttribute('attribute_handle');
</code>
If you need the formatted output supported by some attribute, use this:
<code>
$c = Page::getCurrentPage();
$attributeValue = $c->getAttribute('attribute_handle', 'display');
</code>
An attribute type like "date" will then return the date in the correct format just like other attributes will show you a nicely formatted output and not just a simple value or object.

PageValue|null getAttributeValueObject(string|CollectionKey $akHandle, bool $createIfNotExists = false)

Return the attribute value object with the handle $akHandle of the currently loaded version (if it's loaded).

Parameters

string|CollectionKey $akHandle

the attribute key (or its handle)

bool $createIfNotExists

Return Value

PageValue|null

clearCollectionAttributes(int[] $retainAKIDs = [])

Delete the values of the attributes associated to the currently loaded collection version.

Parameters

int[] $retainAKIDs

a list of attribute key IDs to keep (their values won't be deleted)

clearAttribute(string|CollectionKey $ak, bool $doReindexImmediately = true)

Delete the value of a specific attribute key associated to the currently loaded collection version.

Parameters

string|CollectionKey $ak

the attribute key (or its handle)

bool $doReindexImmediately

PageKey[] getSetCollectionAttributes()

Get the list of attribute keys for which the currently loaded collection version has values.

Return Value

PageKey[]

Area|null getArea(string $arHandle)

Get an existing area associated to this collection.

Parameters

string $arHandle

the handle of the area

Return Value

Area|null

bool hasAliasedContent()

Does this collection contain blocks that are aliased in other pages?

Return Value

bool

CustomStyle|null getAreaCustomStyle(Area $area, bool $force = false)

Get the custom style of an area in the currently loaded collection version.

Parameters

Area $area

the area for which you want the custom styles

bool $force

Set to true to retrieve a CustomStyle even if the area does not define any custom style

Return Value

CustomStyle|null

return NULL if the area does not have any custom style and $force is false, a CustomStyle instance otherwise

setCustomStyleSet(Area $area, StyleSet $set)

Set the custom style of an area in the currently loaded collection version.

Parameters

Area $area
StyleSet $set

resetAreaCustomStyle(Area $area)

Delete all the custom styles of an area of the currently loaded collection version.

Parameters

Area $area

string|null outputCustomStyleHeaderItems(bool $return = false)

Retrieve all custom style rules that should be inserted into the header on a page, whether they are defined in areas or blocks.

Parameters

bool $return

set to true to return the HTML that defines the styles, false to add it to the current View instance

Return Value

string|null

null|false relateVersionEdits(Collection $oc)

Associate the edits of another collection to this collection.

Parameters

Collection $oc

the collection that has been modified

Return Value

null|false

return false if the other collection is already associated to this collection, NULL otherwise

Examples

If a global area is modified inside this collection, you need to call $page->relateVersionEdits($globalArea)

int|false getPageTypeID()

Returns the ID of the page/collection type.

Return Value

int|false

refreshCache()

Empty the collection-related cache.

Block[] getGlobalBlocks()

Get the blocks contained in all the global areas in this collection.

Return Value

Block[]

array getGlobalBlockIDs()

Get the IDs for blocks contained in all the global areas in this collection.

Return Value

array

Return a list of arrays, each one is a dictionary like ['bID' => , 'arHandle' => ]

protected Stack[] getGlobalStacksForCollection()

Get all the global stacks loaded in this collection.

Return Value

Stack[]

Block[] getBlocks(string|false $arHandle = false)

List the blocks in the currently loaded collection version (or in a specific area within it).

Parameters

string|false $arHandle

The handle if the area (or falsy to get all the blocks in the collection)

Return Value

Block[]

array getBlockIDs(string|false $arHandle = false)

List the block IDs and the associated area handles in the currently loaded collection version (or in a specific area within it).

Parameters

string|false $arHandle

The handle if the area (or falsy to get all the blocks in the collection version)

Return Value

array

Return a list of arrays, each one is a dictionary like ['bID' => , 'arHandle' => ]

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

Add a new block to a specific area of the currently loaded collection version.

Parameters

BlockType $bt

the type of block to be added

string|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. Common values are: 'uID' to specify the ID of the author (if not specified: we'll use the current user), 'bName' to specify the block name.

Return Value

Block

int getCollectionAreaDisplayOrder(string $arHandle, bool $ignoreVersions = false)

Get the next value of the display order (to be used when adding new blocks to an area).

Parameters

string $arHandle

The handle of the area

bool $ignoreVersions

Set to true to ignore the collection version

Return Value

int

rescanDisplayOrder(string $arHandle)

Fix the display order properties for all the blocks within the collection/area.

Parameters

string $arHandle

the handle of the area to be processed

void rescanDisplayOrderFromBlock(Block $block, string $arHandle, int $fromDisplay = null)

Fix the display order properties for all the blocks after this block in this area.

This is useful for forcing a certain block order.

Parameters

Block $block

the block to begin the display order rescan from

string $arHandle

the handle of the area to be processed

int $fromDisplay

an optional integer to override the starting number, i.e start from 0 even though our block is 8

Return Value

void

Exceptions

Exception
BindingResolutionException

markModified()

Update the last edit date/time.

delete()

Delete this collection, and all its versions, contents and attributes.

Collection duplicateCollection()

Create a clone of this collection, and all its versions, contents and attributes.

Return Value

Collection

Page cloneVersion(string|null $versionComments, bool $createEmpty = false)

Clone the currently loaded version and returns a Page instance containing the new version.

Parameters

string|null $versionComments

the comments to be associated to the new Version

bool $createEmpty

set to true to create a Version without any blocks/area styles, false to clone them too

Return Value

Page

PageValue|null getAttributeValue(string|CollectionKey $ak) deprecated

deprecated Use of getAttributeValueObject()

No description

Parameters

string|CollectionKey $ak

Return Value

PageValue|null

mixed|null getCollectionAttributeValue(string|CollectionKey $akHandle) deprecated

deprecated use the getAttribute() method

No description

Parameters

string|CollectionKey $akHandle

Return Value

mixed|null

getCollectionTypeID() deprecated

deprecated use the getPageTypeID() method

No description

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

No description

Parameters

$userOrGroup
$permissions
$accessType
$cascadeToChildren

__construct()

Initialize collection until we populate it.

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()

ItemInterface getExporter()

No description

getPermissionResponseClassName()

No description

getPermissionAssignmentClassName()

getPermissionObjectKeyCategoryHandle()

No description

string getSummaryCategoryHandle()

No description

Return Value

string

See also

\Concrete\Core\Summary\Template\Category\CategoryMemberInterface::getSummaryCategoryHandle()

getSummaryIdentifier()

No description

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

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

array getSummaryTemplates()

No description

Return Value

array

protected CustomPageTemplateCollection getCustomPageSummaryTemplateCollection()

No description

bool hasCustomSummaryTemplates()

No description

Return Value

bool

array getCustomSelectedSummaryTemplates()

No description

Return Value

array

int addCollectionAlias(mixed $c)

Make an alias to a page.

Parameters

mixed $c

Return Value

int

The ID of the new collection

void updateCollectionAlias(array $data)

Update the alias details.

Parameters

array $data

Supported keys:

  • string ```customAliasName``` empty string to use the name of the aliased page
  • string ```aliasHandle``` the URL slug of the alias

Return Value

void

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 }

static 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

static 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

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.

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(mixed $cID)

Returns the path for a page from its cID.

Parameters

mixed $cID

int|null getCollectionUserID()

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

Return Value

int|null

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

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

string|null getCustomAliasName()

Get the custom name of the alias page.

Return Value

string|null

NULL if the page is not an alias, empty string if we should use the name of the aliased page, the custom alias name otherwise.

string|null getAliasHandle()

Get the handle of the alias page

Return Value

string|null

NULL if the page is not an alias, the alias handle otherwise

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

setThemeSkin(SkinInterface $skin)

Set the theme skin of this page.

Parameters

SkinInterface $skin

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[]

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

string getPageWrapperClass()

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

Return Value

string

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, mixed $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

mixed $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

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

SiblingRelation[] getPageRelations()

Get the relations of this page.

Return Value

SiblingRelation[]

move(mixed $nc)

Move this page under a new parent page.

Parameters

mixed $nc

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

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

Parameters

null|mixed $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

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

Duplicate this page and return the new Page created.

Parameters

null|mixed $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

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.

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

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(mixed $pt, array $data, mixed $template = false)

Add a new page, child of this page.

Parameters

mixed $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

}

mixed $template

Return Value

Page

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

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

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

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

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

Parameters

mixed $cParent
mixed $cNewParent
bool $preserveUserID

Set to true to preserve the original page author IDs

Site $site

the destination site

getPageSkin()

No description

protected string computeCanonicalPagePath()

Get the canonical path string of this page .

This happens before any uniqueness checks get run.

Return Value

string

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

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

Parameters

int $newCID

the ID of the newly created page

mixed $masterCID
bool $cAcquireComposerOutputControls

protected _associateMasterCollectionAttributes(int $newCID, mixed $masterCID)

Duplicate the master collection attributes to a newly created page.

Parameters

int $newCID

the ID of the newly created page

mixed $masterCID

protected acquireAreaStylesFromDefaults(Template $template)

Copy the area styles from a page template.

Parameters

Template $template

static private string[] translatePermissionsXMLToKeys(SimpleXMLElement $node)

No description

Parameters

SimpleXMLElement $node

Return Value

string[]

static isMultilingualSection($cID)

No description

Parameters

$cID

static protected getLocaleFromHomePageID($cID)

No description

Parameters

$cID

protected setLocale($locale)

No description

Parameters

$locale

static Section getBySectionOfSite(Page $page)

No description

Parameters

Page $page

Return Value

Section

getLanguageText($locale = null)

No description

Parameters

$locale

getLanguage()

No description

getIcon()

No description

getCountry()

No description

int getNumberOfPluralForms()

Returns the number of plural forms.

Return Value

int

Examples

For Japanese: returns 1
For English: returns 2
For French: returns 2
For Russian returns 3

string getPluralsRule()

Returns the rule to determine which plural we should use (in gettext notation).

Return Value

string

Examples

For Japanese: returns '0'
For English: returns 'n != 1'
For French: returns 'n > 1'
For Russian returns '(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : 2)'

array getPluralsCases()

Returns the plural cases for the language; array keys are the case name, array values are some examples for that case.

Return Value

array

Examples

For Japanese: returns
'other' => '0~15, 100, 1000, 10000, 100000, 1000000, …'
For English: returns
'one' => '1',
'other' => '0, 2~16, 100, 1000, 10000, 100000, 1000000, …'
For French: returns
'one' => '0, 1',
'other' => '2~17, 100, 1000, 10000, 100000, 1000000, …'
For Russian returns
'one' => '1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …',
'few' => '2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, …',
'other' => '0, 5~19, 100, 1000, 10000, 100000, 1000000, …',

static getIDList(Site $site = null)

No description

Parameters

Site $site

static getList(Site $site = null)

No description

Parameters

Site $site

static getRelatedCollectionIDForLocale($cID, $locale)

No description

Parameters

$cID
$locale

static getMultilingualPageRelationID($cID)

No description

Parameters

$cID

static isAssigned($page)

No description

Parameters

$page

static getCollectionIDForLocale($mpRelationID, $locale)

No description

Parameters

$mpRelationID
$locale

static registerDuplicate($newPage, $oldPage)

No description

Parameters

$newPage
$oldPage

static Section|false getByLanguage(string $language, Site $site = null)

No description

Parameters

string $language
Site $site

Return Value

Section|false

static Section|false getByLocale($locale, Site $site = null)

No description

Parameters

$locale
Site $site

Return Value

Section|false

static Section getCurrentSection()

Gets the MultilingualSection object for the current section of the site.

Return Value

Section

static getByLocaleOrLanguage($locale)

No description

Parameters

$locale

getLocaleObject()

No description

getLocale()

No description

static getDefaultSection(Site $site = null)

No description

Parameters

Site $site

static unregisterPage($page)

No description

Parameters

$page

static registerPage($page)

No description

Parameters

$page

static registerMove($page, $oldParent, $newParent)

No description

Parameters

$page
$oldParent
$newParent

static relatePage($oldPage, $newPage, $locale)

No description

Parameters

$oldPage
$newPage
$locale

isDefaultMultilingualSection(Site $site = null)

No description

Parameters

Site $site

static ignorePageRelation($page, $locale)

No description

Parameters

$page
$locale

int|null getTranslatedPageID($page)

Receives a page in a different language tree, and tries to return the corresponding page in the current language tree.

Parameters

$page

Return Value

int|null

Translations getSectionInterfaceTranslations(bool $untranslatedFirst = false)

Loads the translations of this multilingual section.

Parameters

bool $untranslatedFirst

Set to true to have untranslated strings first

Return Value

Translations