class Document extends AbstractElement (View source)

Traits

Properties

static array $types possible types of a document
integer $id ID of the document
integer $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)
integer $index Sorter index in the tree, can also be used for generating a navigation and so on
bool $published published or not
integer $creationDate timestamp of creationdate
integer $modificationDate timestamp of modificationdate
integer $userOwner User-ID of the owner
integer $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
boolean $hasChilds Indicator of document has childs or not.
array $siblings Contains a list of sibling documents
boolean $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

$this
setValues(array $data = array())

No description

$this
setValue($key, $value)

No description

array
__sleep()

No description

mixed
__call($method, $args)

No description

void
__clone()

No description

array
getObjectVars()

returns object values without the dao

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

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

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

void
isLocked()

Returns true if the element is locked

array
getUserPermissions()

No description

boolean
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

boolean
hasNoChilds()

Inverted hasChilds()

string
__toString()

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)

Static helper to get a Document by it's path

getById($id)

Static helper to get a Document by it's ID

static Document
create($parentId, $data = array(), $save = true)

Static helper to quickly create a new document

static Listing
getList(array $config = array())

Returns the documents list instance.

static int
getTotalCount(array $config = array())

Get total count of documents.

save()

Save the document.

void
correctPath()

Validate the document path.

void
saveIndex(int $index)

Update the document index.

void
clearDependentCache(array $additionalTags = array())

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)

boolean
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

void
setLocked(bool $locked)

Mark the document as locked.

void
delete()

Deletes the document

string
getFullPath()

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

integer
getCreationDate()

Returns the document creation date.

integer
getId()

Returns the document id.

string
getKey()

Returns the document key.

integer
getModificationDate()

Return the document modification date.

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

void
setCreationDate(integer $creationDate)

Set the creation date of the document.

setId(integer $id)

Set the id of the document.

setKey(integer $key)

Set the document key.

void
setModificationDate(integer $modificationDate)

Set the document modification date.

setParentId(integer $parentId)

Set the parent id of the document.

setPath(string $path)

Set the document path.

integer
getIndex()

Returns the document index.

setIndex(integer $index)

Set the document index.

string
getType()

Returns the document type.

setType(integer $type)

Set the document type.

integer
getUserModification()

Returns id of the user last modified the document.

integer
getUserOwner()

Returns the id of the owner user.

void
setUserModification(integer $userModification)

Set id of the user last modified the document.

void
setUserOwner(integer $userOwner)

Set the id of the owner user.

boolean
isPublished()

Checks if the document is published.

boolean
getPublished()

Checks if the document is published.

setPublished(integer $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

void
removeInheritedProperties()

Removes all inherited properties.

void
renewInheritedProperties()

Renews all inherited properties.

Details

at line line 29
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

$this setValues(array $data = array())

Parameters

array $data

Return Value

$this

$this setValue($key, $value)

Parameters

$key
$value

Return Value

$this

at line line 1295
array __sleep()

Return Value

array

mixed __call($method, $args)

Parameters

$method
$args

Return Value

mixed

Exceptions

Exception

void __clone()

Return Value

void

array getObjectVars()

returns object values without the dao

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

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

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

void isLocked()

Returns true if the element is locked

Return Value

void

array getUserPermissions()

Return Value

array

boolean 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

boolean

unlockPropagate()

boolean hasNoChilds()

Inverted hasChilds()

Return Value

boolean

string __toString()

Return Value

string

mixed getChilds() deprecated

deprecated

Return Value

mixed

mixed setChilds() deprecated

deprecated

Return Value

mixed

mixed hasChilds() deprecated

deprecated

Return Value

mixed

at line line 44
static addDocumentType($type)

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

Parameters

$type

at line line 61
static setHideUnpublished(bool $flag)

Set true if want to hide documents.

Parameters

bool $flag

at line line 71
static bool doHideUnpublished()

Checks if unpublished documents should be hidden.

Return Value

bool

at line line 219
static array getTypes()

get possible types

Return Value

array

at line line 229
static Document|Email|Folder|Hardlink|Link|Page|Printcontainer|Printpage|Snippet getByPath(string $path)

Static helper to get a Document by it's path

Parameters

string $path

Return Value

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

at line line 253
static ElementInterface getById($id)

Static helper to get a Document by it's ID

Parameters

$id

Return Value

ElementInterface $resource

at line line 314
static Document create($parentId, $data = array(), $save = true)

Static helper to quickly create a new document

Parameters

$parentId
$data
$save

Return Value

Document

at line line 338
static Listing getList(array $config = array())

Returns the documents list instance.

Parameters

array $config

Return Value

Listing

Exceptions

Exception

at line line 358
static int getTotalCount(array $config = array())

Get total count of documents.

Parameters

array $config

Return Value

int count

at line line 377
Document save()

Save the document.

Return Value

Document

Exceptions

Exception

at line line 475
void correctPath()

Validate the document path.

Return Value

void

Exceptions

Exception

at line line 579
void saveIndex(int $index)

Update the document index.

Parameters

int $index

Return Value

void

at line line 591
void clearDependentCache(array $additionalTags = array())

Clear the cache related to the document.

Parameters

array $additionalTags

Return Value

void

at line line 608
Dependency getDependencies()

Returns the dependencies of the document

Return Value

Dependency

at line line 622
array setChildren($children)

set the children of the document

Parameters

$children

Return Value

array

at line line 641
array getChildren(bool $unpublished = false)

Get a list of the Childs (not recursivly)

Parameters

bool $unpublished

Return Value

array

at line line 661
boolean hasChildren()

Returns true if the document has at least one child

Return Value

boolean

at line line 680
array getSiblings(bool $unpublished = false)

Get a list of the sibling documents

Parameters

bool $unpublished

Return Value

array

at line line 701
bool hasSiblings()

Returns true if the document has at least one sibling

Return Value

bool

at line line 718
string getLocked()

Returns true if the element is locked

Return Value

string

at line line 733
void setLocked(bool $locked)

Mark the document as locked.

Parameters

bool $locked

Return Value

void

at line line 745
void delete()

Deletes the document

Return Value

void

at line line 790
string getFullPath()

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

Return Value

string

at line line 895
integer getCreationDate()

Returns the document creation date.

Return Value

integer

at line line 905
integer getId()

Returns the document id.

Return Value

integer $id

at line line 915
string getKey()

Returns the document key.

Return Value

string

at line line 925
integer getModificationDate()

Return the document modification date.

Return Value

integer

at line line 935
integer getParentId()

Returns the id of the parent document.

Return Value

integer

at line line 945
string getPath()

Returns the document path.

Return Value

string

at line line 974
string getRealPath()

Returns the real document path.

Return Value

string

at line line 984
string getRealFullPath()

Returns the full real path of the document.

Return Value

string

at line line 997
void setCreationDate(integer $creationDate)

Set the creation date of the document.

Parameters

integer $creationDate

Return Value

void

at line line 1010
Document setId(integer $id)

Set the id of the document.

Parameters

integer $id

Return Value

Document

at line line 1023
Document setKey(integer $key)

Set the document key.

Parameters

integer $key

Return Value

Document

at line line 1037
void setModificationDate(integer $modificationDate)

Set the document modification date.

Parameters

integer $modificationDate

Return Value

void

at line line 1051
Document setParentId(integer $parentId)

Set the parent id of the document.

Parameters

integer $parentId

Return Value

Document

at line line 1065
Document setPath(string $path)

Set the document path.

Parameters

string $path

Return Value

Document

at line line 1077
integer getIndex()

Returns the document index.

Return Value

integer

at line line 1088
Document setIndex(integer $index)

Set the document index.

Parameters

integer $index

Return Value

Document

at line line 1100
string getType()

Returns the document type.

Return Value

string

at line line 1111
Document setType(integer $type)

Set the document type.

Parameters

integer $type

Return Value

Document

at line line 1123
integer getUserModification()

Returns id of the user last modified the document.

Return Value

integer

at line line 1133
integer getUserOwner()

Returns the id of the owner user.

Return Value

integer

at line line 1144
void setUserModification(integer $userModification)

Set id of the user last modified the document.

Parameters

integer $userModification

Return Value

void

at line line 1157
void setUserOwner(integer $userOwner)

Set the id of the owner user.

Parameters

integer $userOwner

Return Value

void

at line line 1169
boolean isPublished()

Checks if the document is published.

Return Value

boolean

at line line 1179
boolean getPublished()

Checks if the document is published.

Return Value

boolean

at line line 1190
Document setPublished(integer $published)

Set the publish status of the document.

Parameters

integer $published

Return Value

Document

at line line 1202
array getProperties()

Get a list of properties (including the inherited)

Return Value

array

at line line 1227
Document setProperties(array $properties)

Set document properties.

Parameters

array $properties

Return Value

Document

at line line 1244
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

at line line 1267
Document getParent()

Returns the parent document instance.

Return Value

Document

at line line 1282
Document setParent(Document $parent)

Set the parent document instance.

Parameters

Document $parent

Return Value

Document

at line line 1323
__wakeup()

at line line 1348
void removeInheritedProperties()

Removes all inherited properties.

Return Value

void

at line line 1367
void renewInheritedProperties()

Renews all inherited properties.

Return Value

void