Node.php
173 * @param $type The type that the Nodes should match (either fully qualified or simple, if not ambiguous)
177 * @param $properties An associative array holding key value pairs that the Node properties should match
179 * @param $useRegExp Boolean whether to interpret the given values/properties as regular expressions or not (default: _true_)
229 self::$logger->warn(StringUtil::getDump($curNode)." found, where a PersistentObject was expected.\n".ErrorHandler::getStackTrace(),
318 * @param $updateOtherSide Boolean whether to update also the other side of the relation (default: _true_)
321 public function addNode(PersistentObject $other, $role=null, $forceSet=false, $trackChange=true, $updateOtherSide=true) {
342 throw new IllegalArgumentException("Maximum number of related objects exceeded: ".$role." (".(sizeof(oldValue)+1)." > ".$maxMultiplicity.")");
385 * @param $role The role of the Node. If null, the role is the Node's type (without namespace) (default: _null_)
386 * @param $updateOtherSide Boolean whether to update also the other side of the relation (default: _true_)
484 * @param $role The role of children to load (maybe null, to load all children) (default: _null_)
485 * @param $buildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build
499 * @param $memOnly Boolean whether to only get the number of loaded children or all children (default: _true_).
509 * @param $type The type that the child should match (either fully qualified or simple, if not ambiguous)
511 * @param $values An associative array holding key value pairs that the child values should match (optional, default: _null_).
512 * @param $properties An associative array holding key value pairs that the child properties should match (optional, default: _null_).
513 * @param $useRegExp Boolean whether to interpret the given values/properties as regular expressions or not (default: _true_)
516 public function getFirstChild($role=null, $type=null, $values=null, $properties=null, $useRegExp=true) {
528 * @param $memOnly Boolean whether to only get the loaded children or all children (default: _true_).
538 * the given relation (including proxies), use the Node::getValue() method and filter the returned
542 * @param $type The type that the children should match (either fully qualified or simple, if not ambiguous)
544 * @param $values An associative array holding key value pairs that the children values should match (optional, default: _null_).
545 * @param $properties An associative array holding key value pairs that the children properties should match (optional, default: _null_).
546 * @param $useRegExp Boolean whether to interpret the given values/properties as regular expressions or not (default: _true_)
594 * @param $buildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build
608 * @param $memOnly Boolean whether to only get the number of loaded parents or all parents (default: _true_).
633 * @param $type The type that the parent should match (either fully qualified or simple, if not ambiguous)
635 * @param $values An associative array holding key value pairs that the parent values should match (optional, default: _null_).
636 * @param $properties An associative array holding key value pairs that the parent properties should match (optional, default: _null_).
637 * @param $useRegExp Boolean whether to interpret the given values/properties as regular expressions or not (default: _true_)
640 public function getFirstParent($role=null, $type=null, $values=null, $properties=null, $useRegExp=true) {
653 * @param $memOnly Boolean whether to only get the loaded parents or all parents (default: _true_).
663 * the given relation (including proxies), use the Node::getValue() method and filter the returned
667 * @param $type The type that the parents should match (either fully qualified or simple, if not ambiguous)
669 * @param $values An associative array holding key value pairs that the parent values should match (optional, default: _null_).
670 * @param $properties An associative array holding key value pairs that the parent properties should match (optional, default: _null_).
671 * @param $useRegExp Boolean whether to interpret the given values/properties as regular expressions or not (default: _true_)
741 * @param $buildDepth One of the BUILDDEPTH constants or a number describing the number of generations to build
797 * @param $memOnly Boolean whether to only get the relatives in memory or all relatives (including proxies) (default: _true_).
loadRelations(array $roles, $buildDepth=BuildDepth::SINGLE)
Load all objects in the given set of relations.
Definition: Node.php:744
loadParents($role=null, $buildDepth=BuildDepth::SINGLE)
Load the parents of a given role and add them.
Definition: Node.php:597
getMapper()
Definition: DefaultPersistentObject.php:123
getFirstParent($role=null, $type=null, $values=null, $properties=null, $useRegExp=true)
Get the first parent that matches given conditions.
Definition: Node.php:640
static getDump($variable, $strlen=100, $width=25, $depth=10, $i=0, &$objects=[])
Get the dump of a variable as string.
Definition: StringUtil.php:29
addNode(PersistentObject $other, $role=null, $forceSet=false, $trackChange=true, $updateOtherSide=true)
Add a Node to the given relation.
Definition: Node.php:321
getPossibleChildren()
Get possible children of this node type (independent of existing children).
Definition: Node.php:581
DefaultPersistentObject is the base class of all persistent objects.
Definition: DefaultPersistentObject.php:34
static getDisplayValue(Node $node, $language=null)
Get the display value for a Node defined by the 'displayValues' property.
Definition: NodeUtil.php:152
const RELATION_STATE_INITIALIZED
Definition: Node.php:38
loadChildren($role=null, $buildDepth=BuildDepth::SINGLE)
Load the children of a given role and add them.
Definition: Node.php:488
getFirstChild($role=null, $type=null, $values=null, $properties=null, $useRegExp=true)
Get the first child that matches given conditions.
Definition: Node.php:516
IllegalArgumentException signals an exception in method arguments.
Definition: IllegalArgumentException.php:18
setState($state)
Definition: DefaultPersistentObject.php:176
StringUtil provides support for string manipulation.
Definition: StringUtil.php:18
getPossibleParents()
Get possible parents of this node type (independent of existing parents).
Definition: Node.php:706
ObjectId is the unique identifier of an object.
Definition: ObjectId.php:28
getState()
Definition: DefaultPersistentObject.php:169
BuildDepth values are used to define the depth when loading object trees.
Definition: BuildDepth.php:19
const RELATION_STATE_UNINITIALIZED
Definition: Node.php:36
getParentsEx(ObjectId $oid=null, $role=null, $type=null, $values=null, $properties=null, $useRegExp=true)
Get the parents that match given conditions.
Definition: Node.php:674
const RELATION_STATE_INITIALIZING
Definition: Node.php:37
getDeletedNodes()
Get the object ids of the nodes that were deleted since the node was loaded.
Definition: Node.php:448
setNodeOrder(array $orderedList, array $movedList=null, $role=null)
Define the order of related Node instances.
Definition: Node.php:463
setValueInternal($name, $value)
Internal (fast) version to set a value without any validation, state change, listener notification et...
Definition: DefaultPersistentObject.php:380
static filter(array $nodeList, ObjectId $oid=null, $type=null, $values=null, $properties=null, $useRegExp=true)
Get Nodes that match given conditions from a list.
Definition: Node.php:182
static getInstance($name, $dynamicConfiguration=[])
Definition: ObjectFactory.php:47
getRelatives($hierarchyType, $memOnly=true)
Get the relatives of a given hierarchyType.
Definition: Node.php:800
PersistentObjectProxy is proxy for an PersistentObject instance.
Definition: PersistentObjectProxy.php:24
getNumRelatives($hierarchyType, $memOnly=true)
Get the number of relatives of a given hierarchyType.
Definition: Node.php:836
PersistentObject defines the interface of all persistent objects.
Definition: PersistentObject.php:23
getChildrenEx(ObjectId $oid=null, $role=null, $type=null, $values=null, $properties=null, $useRegExp=true)
Get the children that match given conditions.
Definition: Node.php:549
setValue($name, $value, $forceSet=false, $trackChange=true)
Definition: Node.php:125
static mergeObjectLists($list1, $list2)
Merge two object lists using the following rules:
Definition: Node.php:267
hasValue($name)
Definition: DefaultPersistentObject.php:387
getRelations($hierarchyType='all')
Get the relation descriptions of a given hierarchyType.
Definition: Node.php:790
getOID()
Definition: DefaultPersistentObject.php:133
LogManager is used to retrieve Logger instances.
Definition: LogManager.php:20
getAddedNodes()
Get the object ids of the nodes that were added since the node was loaded.
Definition: Node.php:378
ObjectFactory implements the service locator pattern by wrapping a Factory instance and providing sta...
Definition: ObjectFactory.php:24
getNodeOrder()
Get the order of related Node instances, if it was defined using the Node::setNodeOrder() method.
Definition: Node.php:477
ErrorHandler catches all php errors and transforms fatal errors into ErrorExceptions and non-fatal in...
Definition: ErrorHandler.php:19
deleteNode(PersistentObject $other, $role=null, $updateOtherSide=true)
Delete a Node from the given relation.
Definition: Node.php:388