class Document extends AbstractElement (View source)

Traits

Properties

protected AbstractDao $dao from AbstractModel
protected int $__dataVersionTimestamp from AbstractElement
static array $types possible types of a document
static protected array $pathCache
int $id ID of the document
int $parentId ID of the parent document, on root document this is null
Document $parent The parent document.
string $type Type of the document as string (enum) Possible values: page,snippet,link,folder
string $key Filename/Key of the document
string $path Path to the document, not conaining the key (the full path of the parent document)
int $index Sorter index in the tree, can also be used for generating a navigation and so on
bool $published published or not
int $creationDate timestamp of creationdate
int $modificationDate timestamp of modificationdate
int $userOwner User-ID of the owner
int $userModification User-ID of the user last modified the document
$userPermissions Permissions for the user which requested this document in editmode*
Dependency $dependencies Dependencies for this document
array $properties List of Property, concerning the folder
array $childs Contains a list of child-documents
bool $hasChilds Indicator of document has childs or not.
array $siblings Contains a list of sibling documents
bool $hasSiblings Indicator if document has siblings or not
string $locked Check if the document is locked.

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

Get the cache tags for the element, resolve all dependencies to tag the cache entries This is necessary to update the cache if there is a change in an depended object

array
resolveDependencies()

Resolves the dependencies of the element and returns an array of them - Used by update()

$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

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.

static 
setHideUnpublished(bool $flag)

Set true if want to hide documents.

static bool
doHideUnpublished()

Checks if unpublished documents should be hidden.

static array
getTypes()

get possible types

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

Static helper to get a Document by it's path

getById($id, bool $force = false)

Static helper to get a Document by it's ID

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

Static helper to quickly create a new document

static Listing
getList(array $config = [])

Returns the documents list instance.

static int
getTotalCount(array $config = [])

Get total count of documents.

save()

No description

correctPath()

Validate the document path.

update(array $params = [])

No description

saveIndex(int $index)

Update the document index.

clearDependentCache(array $additionalTags = [])

Clear the cache related to the document.

getDependencies()

Returns the dependencies of the document

array
setChildren($children)

set the children of the document

array
getChildren(bool $unpublished = false)

Get a list of the Childs (not recursivly)

bool
hasChildren()

Returns true if the document has at least one child

array
getSiblings(bool $unpublished = false)

Get a list of the sibling documents

bool
hasSiblings()

Returns true if the document has at least one sibling

string
getLocked()

Returns true if the element is locked

$this
setLocked(bool $locked)

Mark the document as locked.

delete()

Deletes the document

string
getFullPath()

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

mixed
prepareFrontendPath($path)

No description

int
getCreationDate()

Returns the document creation date.

int
getId()

Returns the document id.

string
getKey()

Returns the document key.

int
getModificationDate()

Return the document modification date.

int
getParentId()

Returns the id of the parent document.

string
getPath()

Returns the document path.

string
getRealPath()

Returns the real document path.

string
getRealFullPath()

Returns the full real path of the document.

$this
setCreationDate(int $creationDate)

Set the creation date of the document.

setId(int $id)

Set the id of the document.

setKey(int $key)

Set the document key.

$this
setModificationDate(int $modificationDate)

Set the document modification date.

setParentId(int $parentId)

Set the parent id of the document.

setPath(string $path)

Set the document path.

int
getIndex()

Returns the document index.

setIndex(int $index)

Set the document index.

string
getType()

Returns the document type.

setType(int $type)

Set the document type.

int
getUserModification()

Returns id of the user last modified the document.

int
getUserOwner()

Returns the id of the owner user.

$this
setUserModification(int $userModification)

Set id of the user last modified the document.

$this
setUserOwner(int $userOwner)

Set the id of the owner user.

bool
isPublished()

Checks if the document is published.

bool
getPublished()

Checks if the document is published.

setPublished(int $published)

Set the publish status of the document.

array
getProperties()

Get a list of properties (including the inherited)

setProperties(array $properties)

Set document properties.

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

Set the document property.

getParent()

Returns the parent document instance.

setParent(Document $parent)

Set the parent document instance.

__wakeup()

No description

removeInheritedProperties()

Removes all inherited properties.

renewInheritedProperties()

Renews all inherited properties.

bool
doRenderWithLegacyStack()

returns true if document should be rendered with legacy stack

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

Get the cache tags for the element, resolve all dependencies to tag the cache entries This is necessary to update the cache if there is a change in an depended object

Parameters

array $tags

Return Value

array

array resolveDependencies()

Resolves the dependencies of the element and returns an array of them - Used by update()

Return Value

array

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

Deletes the document

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