eZPublishCommunityProject(LegacyStack)  2013.9
eZNodeAssignment Class Reference

The class eZNodeAssignment does. More...

+ Inheritance diagram for eZNodeAssignment:
+ Collaboration diagram for eZNodeAssignment:

Public Member Functions

 cloneNodeAssignment ($nextVersionNumber=1, $contentObjectID=false)
 
 eZNodeAssignment ($row)
 
 fetchNode ()
 
 getParentNode ()
 
 getParentObject ()
 
 isCreateOperation ()
 
 isMoveOperation ()
 
 isNopOperation ()
 
 isRemoveOperation ()
 
 isSetOperation ()
 
 name ()
 
 purge ($parentNodeID=false, $contentObjectID=false)
 
 remove ($parentNodeID=false, $contentObjectID=false)
 
 setName ($name)
 
 tempNode ()
 
- Public Member Functions inherited from eZPersistentObject
 attribute ($attr, $noFunction=false)
 Returns the attribute data for $attr, this is either returned from the member variables or a member function depending on whether the definition field or function attributes matched. More...
 
 attributes ()
 Returns the attributes for this object, taken from the definition fields and function attributes. More...
 
 eZPersistentObject ($row)
 Initializes the object with the $row. More...
 
 fill ($row)
 Tries to fill in the data in the object by using the object definition which is returned by the function definition() and the database row data $row. More...
 
 hasAttribute ($attr)
 Checks if $attr is part of the definition fields or function attributes. More...
 
 hasDirtyData ()
 Returns true if the data is considered dirty and needs to be stored. More...
 
 remove ($conditions=null, $extraConditions=null)
 Removes the object from the database, it will use the keys in the object definition to figure out which table row should be removed unless $conditions is defined as an array with fieldnames. More...
 
 setAttribute ($attr, $val)
 Sets the attribute $attr to the value $val. More...
 
 setHasDirtyData ($hasDirtyData)
 Sets whether the object has dirty data or not. More...
 
 store ($fieldFilters=null)
 Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it. More...
 
 sync ($fieldFilters=null)
 Makes sure data is stored if the data is considered dirty. More...
 

Static Public Member Functions

static create ($parameters=array())
 
static definition ()
 
static fetch ($contentObjectID, $version=1, $parentNode=0, $asObject=true)
 
static fetchByID ($id, $asObject=true)
 
static fetchChildCountByVersionStatus ($parentNodeIDList, $status=eZContentObjectVersion::STATUS_PENDING)
 Fetch node assignment count by version status, giving parent node id list. More...
 
static fetchChildListByVersionStatus ($parentNodeIDList, $status=eZContentObjectVersion::STATUS_PENDING, $asObject=true)
 Fetch node assignment list by version status, giving parent node id list. More...
 
static fetchForObject ($contentObjectID, $version=1, $main=0, $asObject=true)
 
static fetchListByID ($idList, $asObject=true)
 
static purgeByID ($assignmentID)
 
static purgeByParentAndContentObjectID ($parentNodeID, $contentObjectID)
 Remove assignments based on their $parentNodeID and $contentObjectID. More...
 
static removeByID ($assignmentID)
 
static setNewMainAssignment ($objectID, $version)
 
- Static Public Member Functions inherited from eZPersistentObject
static conditionText ($conditions)
 Calls conditionTextByRow with an empty row and $conditions. More...
 
static conditionTextByRow ($conditions, $row)
 Generates an SQL sentence from the conditions $conditions and row data $row. More...
 
static count ($def, $conds=null, $field=null)
 Fetches the number of rows by using the object definition. More...
 
static definition ()
 Returns the definition for the object, the default implementation is to return an empty array. More...
 
static escapeArray ($array)
 Escapes strings in an array with the help of eZDBInterface::escapeString(). More...
 
static fetchObject ($def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 Fetches and returns an object based on the given parameters and returns is either as an object or as an array. More...
 
static fetchObjectList ($def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
 Creates an SQL query out of the different parameters and returns an array with the result. More...
 
static getShortAttributeName ($db, $def, $attrName)
 Returns the short attribute name (alias) if it's defined, given attribute name otherwise. More...
 
static handleRows ($rows, $class_name, $asObject)
 Creates PHP objects out of the database rows $rows. More...
 
static newObjectOrder ($def, $orderField, $conditions)
 Returns an order value which can be used for new items in table, for instance placement. More...
 
static removeObject ($def, $conditions=null, $extraConditions=null)
 Deletes the object from the table defined in $def with conditions $conditions and extra conditions $extraConditions. More...
 
static reorderObject ($def, $orderField, $conditions, $down=true)
 Moves a row in a database table. More...
 
static replaceFieldsWithShortNames ($db, $fieldDefs, &$fields)
 For the given array $fields treats its keys (for associative array) or values (for non-associative array) as table fields names and replaces them with short names (aliases) found in $fieldDefs. More...
 
static storeObject ($obj, $fieldFilters=null)
 Stores the data in $obj to database. More...
 
static swapRow ($table, $keys, $order_id, $rows, $id1, $id2)
 Sets row id $id2 to have the placement of row id $id1. More...
 
static updateObjectList ($parameters)
 Updates rows matching the given parameters. More...
 

Public Attributes

 $ContentobjectID
 
 $ContentObjectVersion
 
 $FromNodeID
 
 $ID
 
 $Main
 
 $ParentNode
 
 $ParentRemoteID
 
 $RemoteID
 Used for giving unique values to an assignment which can later be checked. More...
 
 $SortField
 
 $SortOrder
 
const OP_CODE_CREATE = 3
 
const OP_CODE_CREATE_NOP = 2
 
const OP_CODE_EXECUTE = 1
 
const OP_CODE_MOVE = 5
 
const OP_CODE_MOVE_NOP = 4
 
const OP_CODE_NOP = 0
 
const OP_CODE_REMOVE = 7
 
const OP_CODE_REMOVE_NOP = 6
 
const OP_CODE_SET = 9
 
const OP_CODE_SET_NOP = 8
 
- Public Attributes inherited from eZPersistentObject
 $PersistentDataDirty
 

Detailed Description

The class eZNodeAssignment does.

Member Function Documentation

eZNodeAssignment::cloneNodeAssignment (   $nextVersionNumber = 1,
  $contentObjectID = false 
)
eZNodeAssignment::eZNodeAssignment (   $row)

Constructor

Referenced by create(), and fetchChildListByVersionStatus().

static eZNodeAssignment::fetch (   $contentObjectID,
  $version = 1,
  $parentNode = 0,
  $asObject = true 
)
static
static eZNodeAssignment::fetchByID (   $id,
  $asObject = true 
)
static

Fetches the node assignment which has id $id and returns it.

See Also
fetchListByID
static eZNodeAssignment::fetchChildCountByVersionStatus (   $parentNodeIDList,
  $status = eZContentObjectVersion::STATUS_PENDING 
)
static

Fetch node assignment count by version status, giving parent node id list.

Parameters
array$parentNodeIDList
int$status
Returns
int

Referenced by eZContentObjectTreeNode\removeSubtrees().

static eZNodeAssignment::fetchChildListByVersionStatus (   $parentNodeIDList,
  $status = eZContentObjectVersion::STATUS_PENDING,
  $asObject = true 
)
static

Fetch node assignment list by version status, giving parent node id list.

Parameters
array$idListnode id array
int$statusstatus of the object version
boolean$count
boolean$asObjectvalid only when $count is false
Returns
array|int
static eZNodeAssignment::fetchListByID (   $idList,
  $asObject = true 
)
static

Fetches all node assignments which is mentioned in array $ID and returns it.

See Also
fetchByID
eZNodeAssignment::fetchNode ( )

Finds the node for the current assignemnt if it exists and returns it.

Returns
An eZContentObjectTreeNode object or null if no node was found.
See Also
eZContentObjectTreeNode::fetchNode
eZNodeAssignment::getParentNode ( )
eZNodeAssignment::getParentObject ( )
Returns
The contentobject which the parent node points to.
eZNodeAssignment::isCreateOperation ( )

Returns true if the assignment is a create operation.

Returns
bool
eZNodeAssignment::isMoveOperation ( )

Returns true if the assignment is a move operation.

Returns
bool
eZNodeAssignment::isNopOperation ( )

Returns true if the assignment is a nop (no operation) operation.

Returns
bool
eZNodeAssignment::isRemoveOperation ( )

Returns true if the assignment is a remove operation.

Returns
bool
eZNodeAssignment::isSetOperation ( )

Returns true if the assignment is a set (update/create) operation.

Returns
bool
eZNodeAssignment::name ( )
eZNodeAssignment::purge (   $parentNodeID = false,
  $contentObjectID = false 
)

Delete specified nodeassignment if parentNodeID and contentObjectID are given, if they are false it will remove the current node assignment.

Parameters
$parentNodeIDThe ID of the parent node
$contentObjectIDThe ID of the object
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.
static eZNodeAssignment::purgeByID (   $assignmentID)
static

Delelet the node assignment with the ID $assignmentID.

Parameters
$assignmentIDEither an ID or an array with IDs.
Returns
true if it were able to remove the assignments, false if something failed.
Note
If $assignmentID is an empty array it immediately returns false.
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.

Referenced by copyPublishContentObject(), eZContentOperationCollection\removeNodes(), and eZContentOperationCollection\removeOldNodes().

static eZNodeAssignment::purgeByParentAndContentObjectID (   $parentNodeID,
  $contentObjectID 
)
static

Remove assignments based on their $parentNodeID and $contentObjectID.

Parameters
int$parentNodeID
int$contentObjectID

Referenced by eZContentObjectTreeNode\removeThis().

eZNodeAssignment::remove (   $parentNodeID = false,
  $contentObjectID = false 
)

Marks the specified nodeassignment to remove its node. It uses parentNodeID and contentObjectID if they are given, if they are false it will mark the current node assignment.

Parameters
$parentNodeIDThe ID of the parent node
$contentObjectIDThe ID of the object
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.
static eZNodeAssignment::removeByID (   $assignmentID)
static

Marks the node assignment with the ID $assignmentID to remove its node.

Parameters
$assignmentIDEither an ID or an array with IDs.
Returns
true if it were able to remove the assignments, false if something failed.
Note
If $assignmentID is an empty array it immediately returns false.
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.

Referenced by checkNodeActions().

eZNodeAssignment::setName (   $name)
static eZNodeAssignment::setNewMainAssignment (   $objectID,
  $version 
)
static

Chooses and sets new main assignment for the specified object, in case if there's main assignment already.

Returns
false if there is already main assignment, true on success.
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.

Referenced by checkNodeActions().

eZNodeAssignment::tempNode ( )

Member Data Documentation

eZNodeAssignment::$ContentobjectID
eZNodeAssignment::$ContentObjectVersion
eZNodeAssignment::$FromNodeID
eZNodeAssignment::$ID
eZNodeAssignment::$Main
eZNodeAssignment::$ParentNode
eZNodeAssignment::$ParentRemoteID
eZNodeAssignment::$RemoteID

Used for giving unique values to an assignment which can later be checked.

This is often used in templates to provide limited choices for assignments.

eZNodeAssignment::$SortField
eZNodeAssignment::$SortOrder
const eZNodeAssignment::OP_CODE_CREATE = 3
const eZNodeAssignment::OP_CODE_CREATE_NOP = 2
const eZNodeAssignment::OP_CODE_EXECUTE = 1
const eZNodeAssignment::OP_CODE_MOVE_NOP = 4
const eZNodeAssignment::OP_CODE_NOP = 0
const eZNodeAssignment::OP_CODE_REMOVE_NOP = 6
const eZNodeAssignment::OP_CODE_SET = 9
const eZNodeAssignment::OP_CODE_SET_NOP = 8

The documentation for this class was generated from the following file: