class Page extends TargetingDocument (View source)

Traits

Constants

PERSONA_ELEMENT_PREFIX_PREFIXPART

PERSONA_ELEMENT_PREFIX_SUFFIXPART

Properties

protected AbstractDao $dao from AbstractModel
protected int $__dataVersionTimestamp from AbstractElement
static array $types possible types of a document from Document
static protected array $pathCache from Document
int $id ID of the document from Document
int $parentId ID of the parent document, on root document this is null from Document
Document $parent The parent document. from Document
string $type Static type of the document
string $key Filename/Key of the document from Document
string $path Path to the document, not conaining the key (the full path of the parent document) from Document
int $index Sorter index in the tree, can also be used for generating a navigation and so on from Document
bool $published published or not from Document
int $creationDate timestamp of creationdate from Document
int $modificationDate timestamp of modificationdate from Document
int $userOwner User-ID of the owner from Document
int $userModification User-ID of the user last modified the document from Document
$userPermissions Permissions for the user which requested this document in editmode* from Document
Dependency $dependencies Dependencies for this document from Document
array $properties List of Property, concerning the folder from Document
array $childs Contains a list of child-documents from Document
bool $hasChilds Indicator of document has childs or not. from Document
array $siblings Contains a list of sibling documents from Document
bool $hasSiblings Indicator if document has siblings or not from Document
string $locked Check if the document is locked. from Document
array $scheduledTasks Contains all scheduled tasks from ScheduledTasksTrait
string $module from PageSnippet
string $controller from PageSnippet
string $action from PageSnippet
string $template from PageSnippet
array $elements Contains all content-elements of the document from PageSnippet
array $versions Contains all versions of the document from PageSnippet
null|int $contentMasterDocumentId from PageSnippet
protected array $inheritedElements from PageSnippet
bool $legacy from PageSnippet
string $title Contains the title of the page (meta-title)
string $description Contains the description of the page (meta-description)
array $metaData
string $prettyUrl
string $targetGroupIds Comma separated IDs of target groups

Methods

Dao
getDao()

No description

setDao($dao)

No description

getResource() deprecated

No description

initDao(null $key = null, bool $forceDetection = false)

No description

static string|null
locateDaoClass(string $modelClass)

No description

$this
setValues(array $data = [])

No description

$this
setValue($key, $value)

No description

array
__sleep()

No description

mixed
__call($method, $args)

No description

__clone()

No description

array
getObjectVars()

returns object values without the dao

array
__debugInfo()

No description

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

void
configure()

No description

array
getValidTableColumns(string $table, bool $cache)

No description

void
resetValidTableColumnsCache(string $table)

No description

updateModificationInfos()

No description

mixed
getProperty(string $name, bool $asContainer = false)

Get specific property data or the property object itself ($asContainer=true) by its name, if the property doesn't exists return null

bool
hasProperty($name)

No description

removeProperty($name)

No description

string
getCacheTag()

get the cache tag for the element

array
getCacheTags(array $tags = [])

Resolves dependencies and create tags for caching out of them

array
resolveDependencies()

No description

$this
isLocked()

Returns true if the element is locked

array
getUserPermissions()

No description

bool
isAllowed(string $type)

This is used for user-permissions, pass a permission type (eg. list, view, save) an you know if the current user is allowed to perform the requested action

unlockPropagate()

No description

validatePathLength()

No description

bool
hasNoChilds()

Inverted hasChilds()

string
__toString()

No description

int
__getDataVersionTimestamp()

No description

__setDataVersionTimestamp(int $_dataVersionTimestamp)

No description

bool
__isBasedOnLatestData()

No description

from Document
mixed
getChilds() deprecated

No description

mixed
setChilds() deprecated

No description

mixed
hasChilds() deprecated

No description

static 
addDocumentType($type)

Add document type to the $types array. It defines additional document types available in Pimcore.

from Document
static 
setHideUnpublished(bool $flag)

Set true if want to hide documents.

from Document
static bool
doHideUnpublished()

Checks if unpublished documents should be hidden.

from Document
static array
getTypes()

get possible types

from Document
getByPath(string $path, bool $force = false)

Static helper to get a Document by it's path

from Document
getById($id, bool $force = false)

Static helper to get a Document by it's ID

from Document
static Document
create(int $parentId, array $data = [], bool $save = true)

Static helper to quickly create a new document

from Document
static Listing
getList(array $config = [])

Returns the documents list instance.

from Document
static int
getTotalCount(array $config = [])

Get total count of documents.

from Document
save()

No description

from Document
correctPath()

Validate the document path.

from Document
update(array $params = [])

No description

saveIndex(int $index)

Update the document index.

from Document
clearDependentCache(array $additionalTags = [])

Clear the cache related to the document.

from Document
getDependencies()

Returns the dependencies of the document

from Document
array
setChildren($children)

set the children of the document

from Document
array
getChildren(bool $unpublished = false)

Get a list of the Childs (not recursivly)

from Document
bool
hasChildren()

Returns true if the document has at least one child

from Document
array
getSiblings(bool $unpublished = false)

Get a list of the sibling documents

from Document
bool
hasSiblings()

Returns true if the document has at least one sibling

from Document
string
getLocked()

Returns true if the element is locked

from Document
$this
setLocked(bool $locked)

Mark the document as locked.

from Document
delete()

No description

string
getFullPath()

Returns the full path of the document including the key (path+key)

mixed
prepareFrontendPath($path)

No description

from Document
int
getCreationDate()

Returns the document creation date.

from Document
int
getId()

Returns the document id.

from Document
string
getKey()

Returns the document key.

from Document
int
getModificationDate()

Return the document modification date.

from Document
int
getParentId()

Returns the id of the parent document.

from Document
string
getPath()

Returns the document path.

from Document
string
getRealPath()

Returns the real document path.

from Document
string
getRealFullPath()

Returns the full real path of the document.

from Document
$this
setCreationDate(int $creationDate)

Set the creation date of the document.

from Document
setId(int $id)

Set the id of the document.

from Document
setKey(int $key)

Set the document key.

from Document
$this
setModificationDate(int $modificationDate)

Set the document modification date.

from Document
setParentId(int $parentId)

Set the parent id of the document.

from Document
setPath(string $path)

Set the document path.

from Document
int
getIndex()

Returns the document index.

from Document
setIndex(int $index)

Set the document index.

from Document
string
getType()

Returns the document type.

from Document
setType(int $type)

Set the document type.

from Document
int
getUserModification()

Returns id of the user last modified the document.

from Document
int
getUserOwner()

Returns the id of the owner user.

from Document
$this
setUserModification(int $userModification)

Set id of the user last modified the document.

from Document
$this
setUserOwner(int $userOwner)

Set the id of the owner user.

from Document
bool
isPublished()

Checks if the document is published.

from Document
bool
getPublished()

Checks if the document is published.

from Document
setPublished(int $published)

Set the publish status of the document.

from Document
array
getProperties()

Get a list of properties (including the inherited)

from Document
setProperties(array $properties)

Set document properties.

from Document
setProperty(string $name, string $type, mixed $data, bool $inherited = false, bool $inheritable = true)

Set the document property.

from Document
getParent()

Returns the parent document instance.

from Document
setParent(Document $parent)

Set the parent document instance.

from Document
__wakeup()

No description

from Document
removeInheritedProperties()

Removes all inherited properties.

from Document
renewInheritedProperties()

Renews all inherited properties.

from Document
bool
doRenderWithLegacyStack()

returns true if document should be rendered with legacy stack

array
getScheduledTasks()

No description

$this
setScheduledTasks($scheduledTasks)

No description

saveScheduledTasks()

No description

null|Version
saveVersion(bool $setModificationDate = true, bool $callPluginHook = true, $versionNote = null)

No description

string
getAction()

No description

string
getController()

No description

string
getTemplate()

No description

$this
setAction(string $action)

No description

$this
setController(string $controller)

No description

$this
setTemplate(string $template)

No description

$this
setModule($module)

No description

string
getModule()

No description

$this
setRawElement(string $name, string $type, string $data)

Set raw data of an element (eg. for editmode)

$this
setElement(string $name, string $data)

Set an element with the given key/name

$this
removeElement($name)

No description

Tag
getElement(string $name)

Get an element with the given key/name

$this
setContentMasterDocumentId(int|null $contentMasterDocumentId)

No description

int|null
getContentMasterDocumentId()

No description

$this
setContentMasterDocument($document)

No description

bool
hasElement($name)

No description

array
getElements()

No description

$this
setElements(array $elements)

No description

array
getVersions()

No description

$this
setVersions(array $versions)

No description

string
getHref()

No description

bool
isLegacy()

No description

bool
getLegacy()

No description

setLegacy(bool $legacy)

No description

setUseTargetGroup(int $useTargetGroup = null)

No description

int|null
getUseTargetGroup()

No description

string
getTargetGroupElementPrefix(int $targetGroupId = null)

No description

string
getTargetGroupElementName(string $name)

No description

string
getName() deprecated

getProperty method should be used instead

$this
setName(string $name) deprecated

setProperty method should be used instead

string
getDescription()

No description

string
getKeywords() deprecated

No description

string
getTitle()

No description

$this
setDescription(string $description)

No description

$this
setKeywords(string $keywords) deprecated

No description

$this
setTitle(string $title)

No description

$this
setMetaData($metaData)

No description

array
getMetaData()

No description

$this
setPrettyUrl($prettyUrl)

No description

string
getPrettyUrl()

No description

setTargetGroupIds(string|array $targetGroupIds)

Set linked Target Groups as set in properties panel as list of IDs

string
getTargetGroupIds()

Get serialized list of Target Group IDs

setTargetGroups(array $targetGroups)

Set assigned target groups

getTargetGroups()

Return list of assigned target groups (via properties panel)

setPersonas(string $personas) deprecated

No description

string
getPersonas() deprecated

No description

getPersonaElementPrefix($personaId = null) deprecated

No description

getPersonaElementName($name) deprecated

No description

setUsePersona($usePersona) deprecated

No description

getUsePersona() deprecated

No description

string
getPreviewImageFilesystemPath(bool $hdpi = false)

No description

Details

Dao getDao()

Return Value

Dao

AbstractModel setDao($dao)

Parameters

$dao

Return Value

AbstractModel

AbstractDao getResource() deprecated

deprecated

Return Value

AbstractDao

initDao(null $key = null, bool $forceDetection = false)

Parameters

null $key
bool $forceDetection

Exceptions

Exception

static string|null locateDaoClass(string $modelClass)

Parameters

string $modelClass

Return Value

string|null

$this setValues(array $data = [])

Parameters

array $data

Return Value

$this

$this setValue($key, $value)

Parameters

$key
$value

Return Value

$this

array __sleep()

Return Value

array

mixed __call($method, $args)

Parameters

$method
$args

Return Value

mixed

Exceptions

Exception

__clone()

array getObjectVars()

returns object values without the dao

Return Value

array

array __debugInfo()

Return Value

array

void beginTransaction()

Return Value

void

void commit()

Return Value

void

void rollBack()

Return Value

void

void configure()

Return Value

void

array getValidTableColumns(string $table, bool $cache)

Parameters

string $table
bool $cache

Return Value

array

void resetValidTableColumnsCache(string $table)

Parameters

string $table

Return Value

void

protected updateModificationInfos()

mixed getProperty(string $name, bool $asContainer = false)

Get specific property data or the property object itself ($asContainer=true) by its name, if the property doesn't exists return null

Parameters

string $name
bool $asContainer

Return Value

mixed

bool hasProperty($name)

Parameters

$name

Return Value

bool

removeProperty($name)

Parameters

$name

string getCacheTag()

get the cache tag for the element

Return Value

string

array getCacheTags(array $tags = [])

Resolves dependencies and create tags for caching out of them

Parameters

array $tags

Return Value

array

array resolveDependencies()

Return Value

array

See also

Document::resolveDependencies

$this isLocked()

Returns true if the element is locked

Return Value

$this

array getUserPermissions()

Return Value

array

bool isAllowed(string $type)

This is used for user-permissions, pass a permission type (eg. list, view, save) an you know if the current user is allowed to perform the requested action

Parameters

string $type

Return Value

bool

unlockPropagate()

protected validatePathLength()

bool hasNoChilds()

Inverted hasChilds()

Return Value

bool

string __toString()

Return Value

string

int __getDataVersionTimestamp()

Return Value

int

__setDataVersionTimestamp(int $_dataVersionTimestamp)

Parameters

int $_dataVersionTimestamp

bool __isBasedOnLatestData()

Return Value

bool

mixed getChilds() deprecated

deprecated

Return Value

mixed

mixed setChilds() deprecated

deprecated

Return Value

mixed

mixed hasChilds() deprecated

deprecated

Return Value

mixed

static addDocumentType($type)

Add document type to the $types array. It defines additional document types available in Pimcore.

Parameters

$type

static setHideUnpublished(bool $flag)

Set true if want to hide documents.

Parameters

bool $flag

static bool doHideUnpublished()

Checks if unpublished documents should be hidden.

Return Value

bool

static array getTypes()

get possible types

Return Value

array

static Document|Email|Folder|Hardlink|Link|Page|Printcontainer|Printpage|Snippet getByPath(string $path, bool $force = false)

Static helper to get a Document by it's path

Parameters

string $path
bool $force

Return Value

Document|Email|Folder|Hardlink|Link|Page|Printcontainer|Printpage|Snippet

static ElementInterface getById($id, bool $force = false)

Static helper to get a Document by it's ID

Parameters

$id
bool $force

Return Value

ElementInterface $resource

static Document create(int $parentId, array $data = [], bool $save = true)

Static helper to quickly create a new document

Parameters

int $parentId
array $data
bool $save

Return Value

Document

static Listing getList(array $config = [])

Returns the documents list instance.

Parameters

array $config

Return Value

Listing

Exceptions

Exception

static int getTotalCount(array $config = [])

Get total count of documents.

Parameters

array $config

Return Value

int count

Document save()

Return Value

Document

Exceptions

Exception

correctPath()

Validate the document path.

Exceptions

Exception

protected update(array $params = [])

Parameters

array $params additional parameters (e.g. "versionNote" for the version note)

Exceptions

Exception

saveIndex(int $index)

Update the document index.

Parameters

int $index

clearDependentCache(array $additionalTags = [])

Clear the cache related to the document.

Parameters

array $additionalTags

Dependency getDependencies()

Returns the dependencies of the document

Return Value

Dependency

array setChildren($children)

set the children of the document

Parameters

$children

Return Value

array

array getChildren(bool $unpublished = false)

Get a list of the Childs (not recursivly)

Parameters

bool $unpublished

Return Value

array

bool hasChildren()

Returns true if the document has at least one child

Return Value

bool

array getSiblings(bool $unpublished = false)

Get a list of the sibling documents

Parameters

bool $unpublished

Return Value

array

bool hasSiblings()

Returns true if the document has at least one sibling

Return Value

bool

string getLocked()

Returns true if the element is locked

Return Value

string

$this setLocked(bool $locked)

Mark the document as locked.

Parameters

bool $locked

Return Value

$this

delete()

Exceptions

Exception

string getFullPath()

Returns the full path of the document including the key (path+key)

Return Value

string

protected mixed prepareFrontendPath($path)

Parameters

$path

Return Value

mixed

int getCreationDate()

Returns the document creation date.

Return Value

int

int getId()

Returns the document id.

Return Value

int $id

string getKey()

Returns the document key.

Return Value

string

int getModificationDate()

Return the document modification date.

Return Value

int

int getParentId()

Returns the id of the parent document.

Return Value

int

string getPath()

Returns the document path.

Return Value

string

string getRealPath()

Returns the real document path.

Return Value

string

string getRealFullPath()

Returns the full real path of the document.

Return Value

string

$this setCreationDate(int $creationDate)

Set the creation date of the document.

Parameters

int $creationDate

Return Value

$this

Document setId(int $id)

Set the id of the document.

Parameters

int $id

Return Value

Document

Document setKey(int $key)

Set the document key.

Parameters

int $key

Return Value

Document

$this setModificationDate(int $modificationDate)

Set the document modification date.

Parameters

int $modificationDate

Return Value

$this

Document setParentId(int $parentId)

Set the parent id of the document.

Parameters

int $parentId

Return Value

Document

Document setPath(string $path)

Set the document path.

Parameters

string $path

Return Value

Document

int getIndex()

Returns the document index.

Return Value

int

Document setIndex(int $index)

Set the document index.

Parameters

int $index

Return Value

Document

string getType()

Returns the document type.

Return Value

string

Document setType(int $type)

Set the document type.

Parameters

int $type

Return Value

Document

int getUserModification()

Returns id of the user last modified the document.

Return Value

int

int getUserOwner()

Returns the id of the owner user.

Return Value

int

$this setUserModification(int $userModification)

Set id of the user last modified the document.

Parameters

int $userModification

Return Value

$this

$this setUserOwner(int $userOwner)

Set the id of the owner user.

Parameters

int $userOwner

Return Value

$this

bool isPublished()

Checks if the document is published.

Return Value

bool

bool getPublished()

Checks if the document is published.

Return Value

bool

Document setPublished(int $published)

Set the publish status of the document.

Parameters

int $published

Return Value

Document

array getProperties()

Get a list of properties (including the inherited)

Return Value

array

Document setProperties(array $properties)

Set document properties.

Parameters

array $properties

Return Value

Document

Document setProperty(string $name, string $type, mixed $data, bool $inherited = false, bool $inheritable = true)

Set the document property.

Parameters

string $name
string $type
mixed $data
bool $inherited
bool $inheritable

Return Value

Document

Document getParent()

Returns the parent document instance.

Return Value

Document

Document setParent(Document $parent)

Set the parent document instance.

Parameters

Document $parent

Return Value

Document

__wakeup()

removeInheritedProperties()

Removes all inherited properties.

renewInheritedProperties()

Renews all inherited properties.

bool doRenderWithLegacyStack()

returns true if document should be rendered with legacy stack

Return Value

bool

array getScheduledTasks()

Return Value

array the $scheduledTasks

$this setScheduledTasks($scheduledTasks)

Parameters

$scheduledTasks

Return Value

$this

saveScheduledTasks()

null|Version saveVersion(bool $setModificationDate = true, bool $callPluginHook = true, $versionNote = null)

Parameters

bool $setModificationDate
bool $callPluginHook
$versionNote string version note

Return Value

null|Version

Exceptions

Exception

string getAction()

Return Value

string

string getController()

Return Value

string

string getTemplate()

Return Value

string

$this setAction(string $action)

Parameters

string $action

Return Value

$this

$this setController(string $controller)

Parameters

string $controller

Return Value

$this

$this setTemplate(string $template)

Parameters

string $template

Return Value

$this

$this setModule($module)

Parameters

$module

Return Value

$this

string getModule()

Return Value

string

$this setRawElement(string $name, string $type, string $data)

Set raw data of an element (eg. for editmode)

Parameters

string $name
string $type
string $data

Return Value

$this

$this setElement(string $name, string $data)

Set an element with the given key/name

Parameters

string $name
string $data

Return Value

$this

$this removeElement($name)

Parameters

$name

Return Value

$this

Tag getElement(string $name)

Get an element with the given key/name

Parameters

string $name

Return Value

Tag

$this setContentMasterDocumentId(int|null $contentMasterDocumentId)

Parameters

int|null $contentMasterDocumentId

Return Value

$this

Exceptions

Exception

int|null getContentMasterDocumentId()

Return Value

int|null

Document getContentMasterDocument()

Return Value

Document

$this setContentMasterDocument($document)

Parameters

$document

Return Value

$this

bool hasElement($name)

Parameters

$name

Return Value

bool

array getElements()

Return Value

array

$this setElements(array $elements)

Parameters

array $elements

Return Value

$this

array getVersions()

Return Value

array

$this setVersions(array $versions)

Parameters

array $versions

Return Value

$this

string getHref()

Return Value

string

See also

Document::getFullPath

bool isLegacy()

Return Value

bool

bool getLegacy()

Return Value

bool

setLegacy(bool $legacy)

Parameters

bool $legacy

setUseTargetGroup(int $useTargetGroup = null)

Parameters

int $useTargetGroup

int|null getUseTargetGroup()

Return Value

int|null

string getTargetGroupElementPrefix(int $targetGroupId = null)

Parameters

int $targetGroupId

Return Value

string

string getTargetGroupElementName(string $name)

Parameters

string $name

Return Value

string

bool hasTargetGroupSpecificElements()

Return Value

bool

array getTargetGroupSpecificElementNames()

Return Value

array

string getName() deprecated

deprecated

getProperty method should be used instead

Return Value

string

$this setName(string $name) deprecated

deprecated

setProperty method should be used instead

Parameters

string $name

Return Value

$this

string getDescription()

Return Value

string

string getKeywords() deprecated

deprecated

Return Value

string

string getTitle()

Return Value

string

$this setDescription(string $description)

Parameters

string $description

Return Value

$this

$this setKeywords(string $keywords) deprecated

deprecated

Parameters

string $keywords

Return Value

$this

$this setTitle(string $title)

Parameters

string $title

Return Value

$this

$this setMetaData($metaData)

Parameters

$metaData

Return Value

$this

array getMetaData()

Return Value

array

$this setPrettyUrl($prettyUrl)

Parameters

$prettyUrl

Return Value

$this

string getPrettyUrl()

Return Value

string

setTargetGroupIds(string|array $targetGroupIds)

Set linked Target Groups as set in properties panel as list of IDs

Parameters

string|array $targetGroupIds

string getTargetGroupIds()

Get serialized list of Target Group IDs

Return Value

string

setTargetGroups(array $targetGroups)

Set assigned target groups

Parameters

array $targetGroups

TargetGroup[] getTargetGroups()

Return list of assigned target groups (via properties panel)

Return Value

TargetGroup[]

setPersonas(string $personas) deprecated

deprecated Use setTargetGroupIds instead. Will be removed in Pimcore 6.

Parameters

string $personas

string getPersonas() deprecated

deprecated Use getTargetGroupIds instead. Will be removed in Pimcore 6.

Return Value

string

getPersonaElementPrefix($personaId = null) deprecated

deprecated Use getTargetGroupElementPrefix instead. Will be removed in Pimcore 6.

Parameters

$personaId

getPersonaElementName($name) deprecated

deprecated Use getTargetGroupElementName instead. Will be removed in Pimcore 6.

Parameters

$name

setUsePersona($usePersona) deprecated

deprecated Use setUseTargetGroup instead. Will be removed in Pimcore 6.

Parameters

$usePersona

getUsePersona() deprecated

deprecated Use getUseTargetGroup instead. Will be removed in Pimcore 6.

string getPreviewImageFilesystemPath(bool $hdpi = false)

Parameters

bool $hdpi

Return Value

string