Document
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
No description
Get specific property data or the property object itself ($asContainer=true) by its name, if the property doesn't exists return null
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
Resolves the dependencies of the element and returns an array of them - Used by update()
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
No description
Add document type to the $types array. It defines additional document types available in Pimcore.
Set true if want to hide documents.
Checks if unpublished documents should be hidden.
get possible types
Static helper to get a Document by it's path
Static helper to get a Document by it's ID
Static helper to quickly create a new document
Get total count of documents.
Validate the document path.
No description
Update the document index.
Clear the cache related to the document.
Returns the dependencies of the document
set the children of the document
Get a list of the Childs (not recursivly)
Returns true if the document has at least one child
Get a list of the sibling documents
Returns true if the document has at least one sibling
Returns true if the element is locked
Mark the document as locked.
Deletes the document
Returns the full path of the document including the key (path+key)
No description
Returns the document creation date.
Returns the document id.
Returns the document key.
Return the document modification date.
Returns the id of the parent document.
Returns the document path.
Returns the real document path.
Returns the full real path of the document.
Set the creation date of the document.
Set the document modification date.
Set the parent id of the document.
Returns the document index.
Returns the document type.
Returns id of the user last modified the document.
Returns the id of the owner user.
Set id of the user last modified the document.
Set the id of the owner user.
Checks if the document is published.
Checks if the document is published.
Set the publish status of the document.
Get a list of properties (including the inherited)
Set document properties.
Set the document property.
No description
Removes all inherited properties.
Renews all inherited properties.
returns true if document should be rendered with legacy stack
Details
in AbstractModel at line 61
AbstractModel
setDao($dao)
in AbstractModel at line 73
AbstractDao
getResource()
deprecated
deprecated
in AbstractModel at line 84
initDao(null $key = null, bool $forceDetection = false)
in AbstractModel at line 137
static string|null
locateDaoClass(string $modelClass)
in AbstractModel at line 187
$this
setValues(array $data = [])
in AbstractModel at line 204
$this
setValue($key, $value)
at line 1347
array
__sleep()
in AbstractModel at line 242
mixed
__call($method, $args)
in AbstractModel at line 266
__clone()
in AbstractModel at line 276
array
getObjectVars()
returns object values without the dao
in AbstractModel at line 287
array
__debugInfo()
in AbstractModel at line 27
void
beginTransaction()
in AbstractModel at line 27
void
commit()
in AbstractModel at line 27
void
rollBack()
in AbstractModel at line 27
void
configure()
in AbstractModel at line 27
array
getValidTableColumns(string $table, bool $cache)
in AbstractModel at line 27
void
resetValidTableColumnsCache(string $table)
in AbstractElement at line 32
protected
updateModificationInfos()
in AbstractElement at line 63
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
in AbstractElement at line 82
bool
hasProperty($name)
in AbstractElement at line 92
removeProperty($name)
in AbstractElement at line 104
string
getCacheTag()
get the cache tag for the element
in AbstractElement at line 119
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
in AbstractElement at line 133
array
resolveDependencies()
Resolves the dependencies of the element and returns an array of them - Used by update()
in AbstractElement at line 153
$this
isLocked()
Returns true if the element is locked
in AbstractElement at line 166
array
getUserPermissions()
in AbstractElement at line 189
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
in AbstractElement at line 200
unlockPropagate()
in AbstractElement at line 214
protected
validatePathLength()
in AbstractElement at line 226
bool
hasNoChilds()
Inverted hasChilds()
in AbstractElement at line 234
string
__toString()
in AbstractElement at line 242
int
__getDataVersionTimestamp()
in AbstractElement at line 250
__setDataVersionTimestamp(int $_dataVersionTimestamp)
at line 34
bool
__isBasedOnLatestData()
mixed
getChilds()
deprecated
deprecated
mixed
setChilds()
deprecated
deprecated
mixed
hasChilds()
deprecated
deprecated
at line 50
static
addDocumentType($type)
Add document type to the $types array. It defines additional document types available in Pimcore.
at line 67
static
setHideUnpublished(bool $flag)
Set true if want to hide documents.
at line 77
static bool
doHideUnpublished()
Checks if unpublished documents should be hidden.
at line 231
static array
getTypes()
get possible types
at line 244
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
at line 281
static ElementInterface
getById($id, bool $force = false)
Static helper to get a Document by it's ID
at line 345
static Document
create(int $parentId, array $data = [], bool $save = true)
Static helper to quickly create a new document
at line 391
static int
getTotalCount(array $config = [])
Get total count of documents.
at line 509
correctPath()
Validate the document path.
at line 560
protected
update(array $params = [])
at line 612
saveIndex(int $index)
Update the document index.
at line 623
clearDependentCache(array $additionalTags = [])
Clear the cache related to the document.
at line 640
Dependency
getDependencies()
Returns the dependencies of the document
at line 658
array
setChildren($children)
set the children of the document
at line 679
array
getChildren(bool $unpublished = false)
Get a list of the Childs (not recursivly)
at line 698
bool
hasChildren()
Returns true if the document has at least one child
at line 718
array
getSiblings(bool $unpublished = false)
Get a list of the sibling documents
at line 739
bool
hasSiblings()
Returns true if the document has at least one sibling
at line 757
string
getLocked()
Returns true if the element is locked
at line 773
$this
setLocked(bool $locked)
Mark the document as locked.
at line 783
delete()
Deletes the document
at line 828
string
getFullPath()
Returns the full path of the document including the key (path+key)
at line 918
protected mixed
prepareFrontendPath($path)
at line 938
int
getCreationDate()
Returns the document creation date.
at line 948
int
getId()
Returns the document id.
at line 958
string
getKey()
Returns the document key.
at line 968
int
getModificationDate()
Return the document modification date.
at line 978
int
getParentId()
Returns the id of the parent document.
at line 988
string
getPath()
Returns the document path.
at line 1017
string
getRealPath()
Returns the real document path.
at line 1027
string
getRealFullPath()
Returns the full real path of the document.
at line 1041
$this
setCreationDate(int $creationDate)
Set the creation date of the document.
at line 1083
$this
setModificationDate(int $modificationDate)
Set the document modification date.
at line 1124
int
getIndex()
Returns the document index.
at line 1148
string
getType()
Returns the document type.
at line 1172
int
getUserModification()
Returns id of the user last modified the document.
at line 1182
int
getUserOwner()
Returns the id of the owner user.
at line 1194
$this
setUserModification(int $userModification)
Set id of the user last modified the document.
at line 1208
$this
setUserOwner(int $userOwner)
Set the id of the owner user.
at line 1220
bool
isPublished()
Checks if the document is published.
at line 1230
bool
getPublished()
Checks if the document is published.
at line 1254
array
getProperties()
Get a list of properties (including the inherited)
at line 1298
Document
setProperty(string $name, string $type, mixed $data, bool $inherited = false, bool $inheritable = true)
Set the document property.
at line 1371
__wakeup()
at line 1394
removeInheritedProperties()
Removes all inherited properties.
at line 1411
renewInheritedProperties()
Renews all inherited properties.
at line 1431
bool
doRenderWithLegacyStack()
returns true if document should be rendered with legacy stack