Class

eZContentObjectTrashNode

class eZContentObjectTrashNode extends eZContentObjectTreeNode

Encapsulates data about and methods to work with content objects which reside in the trash

Constants

SORT_FIELD_PATH

SORT_FIELD_PUBLISHED

SORT_FIELD_MODIFIED

SORT_FIELD_SECTION

SORT_FIELD_DEPTH

SORT_FIELD_CLASS_IDENTIFIER

SORT_FIELD_CLASS_NAME

SORT_FIELD_PRIORITY

SORT_FIELD_NAME

SORT_FIELD_MODIFIED_SUBNODE

SORT_FIELD_NODE_ID

SORT_FIELD_CONTENTOBJECT_ID

SORT_FIELD_VISIBILITY

SORT_ORDER_DESC

SORT_ORDER_ASC

Properties

bool $PersistentDataDirty Whether the data is dirty, ie needs to be stored, or not.
string|bool $CurrentLanguage
string $Name
string|null $ClassIdentifier
string|null $ClassName

Methods

static  setUseCurrentUserDraft(bool $enable)

Enables / disables Use current user draft mode for data map

from eZContentObjectTreeNode
eZContentObjectAttribute[] dataMap()

Returns an array with all the content object attributes where the keys are the attribute identifiers.

from eZContentObjectTreeNode
string remoteID()

Get the remote id of content node

from eZContentObjectTreeNode
bool isMain()

Returns true if this node is the main node.

from eZContentObjectTreeNode
bool canRead()

Returns true if the node can be read by the current user.

from eZContentObjectTreeNode
bool canPdf()

Returns true if the current user can create a pdf of this content object.

from eZContentObjectTreeNode
bool canViewEmbed()

Returns true if the node can be viewed as embeded object by the current user.

from eZContentObjectTreeNode
bool canEdit()

Returns true if the node can be edited by the current user.

from eZContentObjectTreeNode
bool canHide()

Returns true if the node can be hidden by the current user.

from eZContentObjectTreeNode
bool canCreate()

Returns true if the current user can create a new node as child of this node.

from eZContentObjectTreeNode
bool canRemove()

Returns true if the node can be removed by the current user.

from eZContentObjectTreeNode
bool canMoveFrom()

Returns true if the node can be moved by the current user.

from eZContentObjectTreeNode
bool canMoveTo(bool $classID = false)

Returns true if a node of class $classID can be moved to the current node by the current user.

from eZContentObjectTreeNode
bool canSwap()

Returns true if a node can be swaped by the current user.

from eZContentObjectTreeNode
bool canAddLocation()

Returns true if current user can add object locations to current node.

from eZContentObjectTreeNode
bool canRemoveLocation()

Returns true if current user can add object locations to current node.

from eZContentObjectTreeNode
array|null subTree(array|bool $params = false)

from eZContentObjectTreeNode
subTreeCount($params = array())

from eZContentObjectTreeNode
childrenByName($name)

from eZContentObjectTreeNode
array|null children()

Returns the first level children in sorted order.

from eZContentObjectTreeNode
childrenCount($checkPolicies = true)

from eZContentObjectTreeNode
viewCount()

from eZContentObjectTreeNode
sortArray()

from eZContentObjectTreeNode
fetchByCRC($pathStr)

from eZContentObjectTreeNode
fetchParent()

from eZContentObjectTreeNode
pathArray()

from eZContentObjectTreeNode
fetchPath()

from eZContentObjectTreeNode
addChild($contentobjectID, $asObject = false, $contentObjectVersion = false)

from eZContentObjectTreeNode
pathWithNames($regenerateCurrent = false)

from eZContentObjectTreeNode
checkPath($path)

from eZContentObjectTreeNode
adjustPathElement($element, $useParentFromNodeObject = false)

from eZContentObjectTreeNode
updateSubTreePath($updateParent = true, $nodeMove = false)

from eZContentObjectTreeNode
updatePathIdentificationString($pathIdentificationName)

from eZContentObjectTreeNode
removeThis()

from eZContentObjectTreeNode
removeNodeFromTree($moveToTrash = true)

from eZContentObjectTreeNode
int subtreeSoleNodeCount(array $params = array())

Returns the number of nodes in the current subtree that have no other placements.

from eZContentObjectTreeNode
move($newParentNodeID, $nodeID)

from eZContentObjectTreeNode
checkAccess($functionName, $originalClassID = false, $parentClassID = false, $returnAccessList = false, $language = false)

from eZContentObjectTreeNode
classListFromPolicy($policy, $allowedLanguageCodes = false)

from eZContentObjectTreeNode
canCreateClassList($asObject = false, $includeFilter = true, $groupList = false, $fetchID = false)

from eZContentObjectTreeNode
static  makeObjectsArray($array, $with_contentobject = true, array $propertiesOverride = null, $lang = null)

from eZContentObjectTreeNode
getName($language = false)

from eZContentObjectTreeNode
setName($name)

from eZContentObjectTreeNode
serialize($options, $contentNodeIDArray, $topNodeIDArray)

from eZContentObjectTreeNode
updateAndStoreModified()

from eZContentObjectTreeNode
void store(array|null $fieldFilters = null)

Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it.

from eZContentObjectTreeNode
eZContentObject object()

Returns the eZContentObject associated to this node

from eZContentObjectTreeNode
bool hasContentObject()

Checks if the node's contentobject has already loaded

from eZContentObjectTreeNode
setContentObject(eZContentObject $object)

Sets the current content object for this node.

from eZContentObjectTreeNode
eZContentObject creator()

Returns the creator of the version published in the node.

from eZContentObjectTreeNode
eZContentObjectVersion|array|bool contentObjectVersionObject(bool $asObject = true)

Returns the eZContentObjectVersionObject of the current node

from eZContentObjectTreeNode
string urlAlias()

Returns the node's url alias

from eZContentObjectTreeNode
string url()

Returns the node's full url (/content/view/full/...)

from eZContentObjectTreeNode
string|bool|string|null classIdentifier()

Returns the node's class identifier

from eZContentObjectTreeNode
string|null className()

Returns the node's class name

from eZContentObjectTreeNode
int|null classIsContainer()

Returns 1 if the node's class is a container class, 0 otherwise

from eZContentObjectTreeNode
string hiddenInvisibleString()

Returns combined string representation of both "ishidden" and "isinvisible" attributes

from eZContentObjectTreeNode
string hiddenStatusString()

Returns combined string representation of both "ishidden" and "isinvisible" attributes Used in the limitation handling templates.

from eZContentObjectTreeNode
string currentLanguage()

Returns the node's current language

from eZContentObjectTreeNode
setCurrentLanguage(string $languageCode)

Sets the current node's language to $languageCode

from eZContentObjectTreeNode
string availableClassesJsArray()

Returns available classes as Js array.

from eZContentObjectTreeNode
bool isNodeTrashAllowed()

Figure out if a node can be sent to trash or if it should be directly deleted as objects containing ezuser attributes can not be sent to trash.

from eZContentObjectTreeNode
storeToTrash()

Stores this object to the trash

eZContentObjectTreeNode|null originalParent()

Returns the parent of the current node in the tree before it has been moved to the trash or null when the original parent couldn't be retrieved (e.g.

string originalParentPathIdentificationString()

Returns the path identification string of the node's parent, if available.

static eZContentObjectTrashNode|null fetchByContentObjectID(int $contentObjectID, bool $asObject = true, int|bool $contentObjectVersion = false)

Fetches a trash node by its content object id

Details

static public setUseCurrentUserDraft(bool $enable)

Enables / disables Use current user draft mode for data map

When this mode is enabled (disabled by default), current user draft is used if available on all dataMap calls.

Parameters

bool $enable

public eZContentObjectAttribute[] dataMap()

Returns an array with all the content object attributes where the keys are the attribute identifiers.

Return Value

eZContentObjectAttribute[]

See also

eZContentObject::fetchDataMap()

public string remoteID()

Get the remote id of content node

If there is no remote ID a new unique one will be generated.

The remote ID is often used to synchronise imports and exports.

Return Value

string

public bool isMain()

Returns true if this node is the main node.

Return Value

bool

public bool canRead()

Returns true if the node can be read by the current user.

Return Value

bool

public bool canPdf()

Returns true if the current user can create a pdf of this content object.

Return Value

bool

public bool canViewEmbed()

Returns true if the node can be viewed as embeded object by the current user.

Return Value

bool

public bool canEdit()

Returns true if the node can be edited by the current user.

Return Value

bool

public bool canHide()

Returns true if the node can be hidden by the current user.

Return Value

bool

public bool canCreate()

Returns true if the current user can create a new node as child of this node.

Return Value

bool

public bool canRemove()

Returns true if the node can be removed by the current user.

Return Value

bool

public bool canMoveFrom()

Returns true if the node can be moved by the current user.

Return Value

bool

public bool canMoveTo(bool $classID = false)

Returns true if a node of class $classID can be moved to the current node by the current user.

Parameters

bool $classID

Return Value

bool

public bool canSwap()

Returns true if a node can be swaped by the current user.

Return Value

bool

public bool canAddLocation()

Returns true if current user can add object locations to current node.

Return Value

bool

public bool canRemoveLocation()

Returns true if current user can add object locations to current node.

Return Value

bool

in eZContentObjectTreeNode at line 2091
public array|null subTree(array|bool $params = false)

Parameters

array|bool $params

Return Value

array|null

in eZContentObjectTreeNode at line 2515
public subTreeCount($params = array())

Parameters

$params

in eZContentObjectTreeNode at line 2631
public childrenByName($name)

Parameters

$name

in eZContentObjectTreeNode at line 2662
public array|null children()

Returns the first level children in sorted order.

Return Value

array|null

in eZContentObjectTreeNode at line 2674
public childrenCount($checkPolicies = true)

Parameters

$checkPolicies

in eZContentObjectTreeNode at line 2686
public viewCount()

in eZContentObjectTreeNode at line 2775
public sortArray()

in eZContentObjectTreeNode at line 2898
public fetchByCRC($pathStr)

Parameters

$pathStr

in eZContentObjectTreeNode at line 3188
public fetchParent()

in eZContentObjectTreeNode at line 3193
public pathArray()

in eZContentObjectTreeNode at line 3207
public fetchPath()

in eZContentObjectTreeNode at line 3295
public addChild($contentobjectID, $asObject = false, $contentObjectVersion = false)

Parameters

$contentobjectID
$asObject
$contentObjectVersion

in eZContentObjectTreeNode at line 3368
public pathWithNames($regenerateCurrent = false)

Parameters

$regenerateCurrent

in eZContentObjectTreeNode at line 3439
public checkPath($path)

Parameters

$path

in eZContentObjectTreeNode at line 3463
public adjustPathElement($element, $useParentFromNodeObject = false)

Parameters

$element
$useParentFromNodeObject

in eZContentObjectTreeNode at line 3492
public updateSubTreePath($updateParent = true, $nodeMove = false)

Parameters

$updateParent
$nodeMove

in eZContentObjectTreeNode at line 3625
public updatePathIdentificationString($pathIdentificationName)

Parameters

$pathIdentificationName

in eZContentObjectTreeNode at line 3693
public removeThis()

in eZContentObjectTreeNode at line 4082
public removeNodeFromTree($moveToTrash = true)

Parameters

$moveToTrash

in eZContentObjectTreeNode at line 4152
public int subtreeSoleNodeCount(array $params = array())

Returns the number of nodes in the current subtree that have no other placements.

Parameters

array $params

Return Value

int

in eZContentObjectTreeNode at line 4224
public move($newParentNodeID, $nodeID)

Parameters

$newParentNodeID
$nodeID

in eZContentObjectTreeNode at line 4342
public checkAccess($functionName, $originalClassID = false, $parentClassID = false, $returnAccessList = false, $language = false)

Parameters

$functionName
$originalClassID
$parentClassID
$returnAccessList
$language

in eZContentObjectTreeNode at line 4810
public classListFromPolicy($policy, $allowedLanguageCodes = false)

Parameters

$policy
$allowedLanguageCodes

in eZContentObjectTreeNode at line 5061
public canCreateClassList($asObject = false, $includeFilter = true, $groupList = false, $fetchID = false)

Parameters

$asObject
$includeFilter
$groupList
$fetchID

in eZContentObjectTreeNode at line 5211
static public makeObjectsArray($array, $with_contentobject = true, array $propertiesOverride = null, $lang = null)

Parameters

$array
$with_contentobject
array $propertiesOverride
$lang

in eZContentObjectTreeNode at line 5478
public getName($language = false)

Parameters

$language

in eZContentObjectTreeNode at line 5516
public setName($name)

Parameters

$name

in eZContentObjectTreeNode at line 5662
public serialize($options, $contentNodeIDArray, $topNodeIDArray)

Parameters

$options
$contentNodeIDArray
$topNodeIDArray

in eZContentObjectTreeNode at line 5700
public updateAndStoreModified()

in eZContentObjectTreeNode at line 5721
public void store(array|null $fieldFilters = null)

Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it.

Note: Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Parameters

array|null $fieldFilters

Return Value

void

in eZContentObjectTreeNode at line 5736
public eZContentObject object()

Returns the eZContentObject associated to this node

Return Value

eZContentObject

in eZContentObjectTreeNode at line 5757
public bool hasContentObject()

Checks if the node's contentobject has already loaded

Return Value

bool

in eZContentObjectTreeNode at line 5770
public setContentObject(eZContentObject $object)

Sets the current content object for this node.

Parameters

eZContentObject $object

in eZContentObjectTreeNode at line 5780
public eZContentObject creator()

Returns the creator of the version published in the node.

Return Value

eZContentObject

in eZContentObjectTreeNode at line 5799
public eZContentObjectVersion|array|bool contentObjectVersionObject(bool $asObject = true)

Returns the eZContentObjectVersionObject of the current node

Parameters

bool $asObject

Return Value

eZContentObjectVersion|array|bool

in eZContentObjectTreeNode at line 5814
public string urlAlias()

Returns the node's url alias

Return Value

string

in eZContentObjectTreeNode at line 5856
public string url()

Returns the node's full url (/content/view/full/...)

Return Value

string

in eZContentObjectTreeNode at line 5871
public string|bool|string|null classIdentifier()

Returns the node's class identifier

Return Value

string|bool|string|null

in eZContentObjectTreeNode at line 5887
public string|null className()

Returns the node's class name

Return Value

string|null

in eZContentObjectTreeNode at line 5904
public int|null classIsContainer()

Returns 1 if the node's class is a container class, 0 otherwise

Return Value

int|null

in eZContentObjectTreeNode at line 5921
public string hiddenInvisibleString()

Returns combined string representation of both "ishidden" and "isinvisible" attributes

Return Value

string

in eZContentObjectTreeNode at line 5932
public string hiddenStatusString()

Returns combined string representation of both "ishidden" and "isinvisible" attributes Used in the limitation handling templates.

Return Value

string

in eZContentObjectTreeNode at line 6201
public string currentLanguage()

Returns the node's current language

Return Value

string

in eZContentObjectTreeNode at line 6211
public setCurrentLanguage(string $languageCode)

Sets the current node's language to $languageCode

Parameters

string $languageCode

in eZContentObjectTreeNode at line 6246
public string availableClassesJsArray()

Returns available classes as Js array.

Checks if the node is container, if yes emptyStr will be returned.

Return Value

string

in eZContentObjectTreeNode at line 6401
public bool isNodeTrashAllowed()

Figure out if a node can be sent to trash or if it should be directly deleted as objects containing ezuser attributes can not be sent to trash.

Return Value

bool true if it can go to trash, false if it should be deleted

at line 146
public storeToTrash()

Stores this object to the trash

Loops through all attributes of the object and stores them to the trash

See also

eZDataType::trashStoredObjectAttribute()

at line 324
public eZContentObjectTreeNode|null originalParent()

Returns the parent of the current node in the tree before it has been moved to the trash or null when the original parent couldn't be retrieved (e.g.

because it has been deleted, too, or moved)

Return Value

eZContentObjectTreeNode|null

at line 357
public string originalParentPathIdentificationString()

Returns the path identification string of the node's parent, if available.

Otherwise returns the node's path identification string

Return Value

string

See also

originalParent()

at line 378
static public eZContentObjectTrashNode|null fetchByContentObjectID(int $contentObjectID, bool $asObject = true, int|bool $contentObjectVersion = false)

Fetches a trash node by its content object id

Parameters

int $contentObjectID
bool $asObject
int|bool $contentObjectVersion

Return Value

eZContentObjectTrashNode|null