PHP Class Pimcore\Model\Document

Inheritance: extends Pimcore\Model\Element\AbstractElement
Exibir arquivo Open project: pimcore/pimcore Class Usage Examples

Public Properties

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

Public Methods

Method Description
__sleep ( )
__wakeup ( )
addDocumentType ( $type ) Add document type to the $types array. It defines additional document types available in Pimcore.
clearDependentCache ( array $additionalTags = [] ) : void Clear the cache related to the document.
correctPath ( ) : void Validate the document path.
create ( integer $parentId, array $data = [], $save = true ) : Document Static helper to quickly create a new document
delete ( ) : void Deletes the document
doHideUnpublished ( ) : boolean Checks if unpublished documents should be hidden.
getById ( integer $id ) : Document | Email | Folder | Hardlink | Link | Page | Printcontainer | Printpage | Snippet | Newsletter Static helper to get a Document by it's ID
getByPath ( string $path ) : Document | Email | Folder | Hardlink | Link | Page | Printcontainer | Printpage | Snippet Static helper to get a Document by it's path
getChildren ( $unpublished = false ) : array Get a list of the Childs (not recursivly)
getCreationDate ( ) : integer Returns the document creation date.
getDependencies ( ) : Dependency Returns the dependencies of the document
getFullPath ( ) : string Returns the full path of the document including the key (path+key)
getId ( ) : integer Returns the document id.
getIndex ( ) : integer Returns the document index.
getKey ( ) : string Returns the document key.
getList ( array $config = [] ) : Listing Returns the documents list instance.
getLocked ( ) : string Returns true if the element is locked
getModificationDate ( ) : integer Return the document modification date.
getParent ( ) : Document Returns the parent document instance.
getParentId ( ) : integer Returns the id of the parent document.
getPath ( ) : string Returns the document path.
getProperties ( ) : Property[] Get a list of properties (including the inherited)
getPublished ( ) : boolean Checks if the document is published.
getRealFullPath ( ) : string Returns the full real path of the document.
getRealPath ( ) : string Returns the real document path.
getSiblings ( boolean $unpublished = false ) : array Get a list of the sibling documents
getTotalCount ( array $config = [] ) : integer Get total count of documents.
getType ( ) : string Returns the document type.
getTypes ( ) : string get possible types
getUserModification ( ) : integer Returns id of the user last modified the document.
getUserOwner ( ) : integer Returns the id of the owner user.
hasChildren ( ) : boolean Returns true if the document has at least one child
hasSiblings ( ) : boolean Returns true if the document has at least one sibling
isPublished ( ) : boolean Checks if the document is published.
removeInheritedProperties ( ) : void Removes all inherited properties.
renewInheritedProperties ( ) : void Renews all inherited properties.
save ( ) : Document Save the document.
saveIndex ( integer $index ) : void Update the document index.
setChildren ( $children ) : array set the children of the document
setCreationDate ( integer $creationDate ) : Document Set the creation date of the document.
setHideUnpublished ( boolean $flag ) Set true if want to hide documents.
setId ( integer $id ) : Document Set the id of the document.
setIndex ( integer $index ) : Document Set the document index.
setKey ( integer $key ) : Document Set the document key.
setLocked ( $locked ) : Document Mark the document as locked.
setModificationDate ( integer $modificationDate ) : Document Set the document modification date.
setParent ( Document $parent ) : Document Set the parent document instance.
setParentId ( integer $parentId ) : Document Set the parent id of the document.
setPath ( string $path ) : Document Set the document path.
setProperties ( array $properties ) : Document Set document properties.
setProperty ( string $name, string $type, mixed $data, boolean $inherited = false, boolean $inheritable = true ) : Document Set the document property.
setPublished ( integer $published ) : Document Set the publish status of the document.
setType ( integer $type ) : Document Set the document type.
setUserModification ( integer $userModification ) : Document Set id of the user last modified the document.
setUserOwner ( integer $userOwner ) : Document Set the id of the owner user.

Protected Methods

Method Description
prepareFrontendPath ( $path ) : mixed
update ( )

Method Details

__sleep() public method

public __sleep ( )

__wakeup() public method

public __wakeup ( )

addDocumentType() public static method

Add document type to the $types array. It defines additional document types available in Pimcore.
public static addDocumentType ( $type )
$type

clearDependentCache() public method

Clear the cache related to the document.
public clearDependentCache ( array $additionalTags = [] ) : void
$additionalTags array
return void

correctPath() public method

Validate the document path.
public correctPath ( ) : void
return void

create() public static method

Static helper to quickly create a new document
public static create ( integer $parentId, array $data = [], $save = true ) : Document
$parentId integer
$data array
return Document

delete() public method

Deletes the document
public delete ( ) : void
return void

doHideUnpublished() public static method

Checks if unpublished documents should be hidden.
public static doHideUnpublished ( ) : boolean
return boolean

getById() public static method

Static helper to get a Document by it's ID
public static getById ( integer $id ) : Document | Email | Folder | Hardlink | Link | Page | Printcontainer | Printpage | Snippet | Newsletter
$id integer
return Document | Email | Folder | Hardlink | Link | Page | Printcontainer | Printpage | Snippet | Newsletter

getByPath() public static method

Static helper to get a Document by it's path
public static getByPath ( string $path ) : Document | Email | Folder | Hardlink | Link | Page | Printcontainer | Printpage | Snippet
$path string
return Document | Email | Folder | Hardlink | Link | Page | Printcontainer | Printpage | Snippet

getChildren() public method

Get a list of the Childs (not recursivly)
public getChildren ( $unpublished = false ) : array
return array

getCreationDate() public method

Returns the document creation date.
public getCreationDate ( ) : integer
return integer

getDependencies() public method

Returns the dependencies of the document
public getDependencies ( ) : Dependency
return Dependency

getFullPath() public method

Returns the full path of the document including the key (path+key)
public getFullPath ( ) : string
return string

getId() public method

Returns the document id.
public getId ( ) : integer
return integer

getIndex() public method

Returns the document index.
public getIndex ( ) : integer
return integer

getKey() public method

Returns the document key.
public getKey ( ) : string
return string

getList() public static method

Returns the documents list instance.
public static getList ( array $config = [] ) : Listing
$config array
return Pimcore\Model\Document\Listing

getLocked() public method

Returns true if the element is locked
public getLocked ( ) : string
return string

getModificationDate() public method

Return the document modification date.
public getModificationDate ( ) : integer
return integer

getParent() public method

Returns the parent document instance.
public getParent ( ) : Document
return Document

getParentId() public method

Returns the id of the parent document.
public getParentId ( ) : integer
return integer

getPath() public method

Returns the document path.
public getPath ( ) : string
return string

getProperties() public method

Get a list of properties (including the inherited)
public getProperties ( ) : Property[]
return Property[]

getPublished() public method

Checks if the document is published.
public getPublished ( ) : boolean
return boolean

getRealFullPath() public method

Returns the full real path of the document.
public getRealFullPath ( ) : string
return string

getRealPath() public method

Returns the real document path.
public getRealPath ( ) : string
return string

getSiblings() public method

Get a list of the sibling documents
public getSiblings ( boolean $unpublished = false ) : array
$unpublished boolean
return array

getTotalCount() public static method

Get total count of documents.
public static getTotalCount ( array $config = [] ) : integer
$config array
return integer count

getType() public method

Returns the document type.
public getType ( ) : string
return string

getTypes() public static method

get possible types
public static getTypes ( ) : string
return string

getUserModification() public method

Returns id of the user last modified the document.
public getUserModification ( ) : integer
return integer

getUserOwner() public method

Returns the id of the owner user.
public getUserOwner ( ) : integer
return integer

hasChildren() public method

Returns true if the document has at least one child
public hasChildren ( ) : boolean
return boolean

hasSiblings() public method

Returns true if the document has at least one sibling
public hasSiblings ( ) : boolean
return boolean

isPublished() public method

Checks if the document is published.
public isPublished ( ) : boolean
return boolean

prepareFrontendPath() protected method

protected prepareFrontendPath ( $path ) : mixed
$path
return mixed

removeInheritedProperties() public method

Removes all inherited properties.
public removeInheritedProperties ( ) : void
return void

renewInheritedProperties() public method

Renews all inherited properties.
public renewInheritedProperties ( ) : void
return void

save() public method

Save the document.
public save ( ) : Document
return Document

saveIndex() public method

Update the document index.
public saveIndex ( integer $index ) : void
$index integer
return void

setChildren() public method

set the children of the document
public setChildren ( $children ) : array
return array

setCreationDate() public method

Set the creation date of the document.
public setCreationDate ( integer $creationDate ) : Document
$creationDate integer
return Document

setHideUnpublished() public static method

Set true if want to hide documents.
public static setHideUnpublished ( boolean $flag )
$flag boolean

setId() public method

Set the id of the document.
public setId ( integer $id ) : Document
$id integer
return Document

setIndex() public method

Set the document index.
public setIndex ( integer $index ) : Document
$index integer
return Document

setKey() public method

Set the document key.
public setKey ( integer $key ) : Document
$key integer
return Document

setLocked() public method

Mark the document as locked.
public setLocked ( $locked ) : Document
$locked
return Document

setModificationDate() public method

Set the document modification date.
public setModificationDate ( integer $modificationDate ) : Document
$modificationDate integer
return Document

setParent() public method

Set the parent document instance.
public setParent ( Document $parent ) : Document
$parent Document
return Document

setParentId() public method

Set the parent id of the document.
public setParentId ( integer $parentId ) : Document
$parentId integer
return Document

setPath() public method

Set the document path.
public setPath ( string $path ) : Document
$path string
return Document

setProperties() public method

Set document properties.
public setProperties ( array $properties ) : Document
$properties array
return Document

setProperty() public method

Set the document property.
public setProperty ( string $name, string $type, mixed $data, boolean $inherited = false, boolean $inheritable = true ) : Document
$name string
$type string
$data mixed
$inherited boolean
$inheritable boolean
return Document

setPublished() public method

Set the publish status of the document.
public setPublished ( integer $published ) : Document
$published integer
return Document

setType() public method

Set the document type.
public setType ( integer $type ) : Document
$type integer
return Document

setUserModification() public method

Set id of the user last modified the document.
public setUserModification ( integer $userModification ) : Document
$userModification integer
return Document

setUserOwner() public method

Set the id of the owner user.
public setUserOwner ( integer $userOwner ) : Document
$userOwner integer
return Document

update() protected method

protected update ( )

Property Details

$childs public_oe property

Contains a list of child-documents
public array $childs
return array

$creationDate public_oe property

timestamp of creationdate
public int $creationDate
return integer

$dependencies public_oe property

Dependencies for this document
public Dependency,Pimcore\Model $dependencies
return Dependency

$hasChilds public_oe property

Indicator of document has childs or not.
public bool $hasChilds
return boolean

$hasSiblings public_oe property

Indicator if document has siblings or not
public bool $hasSiblings
return boolean

$id public_oe property

ID of the document
public int $id
return integer

$index public_oe property

Sorter index in the tree, can also be used for generating a navigation and so on
public int $index
return integer

$key public_oe property

Filename/Key of the document
public string $key
return string

$locked public_oe property

Check if the document is locked.
public string $locked
return string

$modificationDate public_oe property

timestamp of modificationdate
public int $modificationDate
return integer

$parent public_oe property

The parent document.
public Document,Pimcore\Model $parent
return Document

$parentId public_oe property

ID of the parent document, on root document this is null
public int $parentId
return integer

$path public_oe property

Path to the document, not conaining the key (the full path of the parent document)
public string $path
return string

$properties public_oe property

List of Property, concerning the folder
public array $properties
return array

$published public_oe property

published or not
public bool $published
return boolean

$siblings public_oe property

Contains a list of sibling documents
public array $siblings
return array

$type public_oe property

Type of the document as string (enum) Possible values: page,snippet,link,folder
public string $type
return string

$types public_oe static_oe property

possible types of a document
public static array $types
return array

$userModification public_oe property

User-ID of the user last modified the document
public int $userModification
return integer

$userOwner public_oe property

User-ID of the owner
public int $userOwner
return integer

$userPermissions public_oe property

Permissions for the user which requested this document in editmode*
public $userPermissions