Class Node

Description

A Node class represents a Node object in the hierarchy that makes up the content repository.

A node must have one and only one parent node. A node can have children. The Node class extends the Item class.

  • author:
  • version: 1.0

Located in /Node.php (line 12)

Item
   |
   --Node
Method Summary
 Node addNode (string $path)
 Node getNode (string $path)
 Property getProperty (string $path)
 boolean hasNode (string $path)
 boolean hasNodes ()
 boolean hasProperties ()
 boolean hasProperty (string $path)
 boolean hasReferences ()
 void isLocked ()
 void lock ()
 Property setProperty (string $name, generic $value)
 void unlock ()
Variables

Inherited Variables

Inherited from Item

Item::$name
Item::$path
Item::$pm
Item::$value
Item::$workspace
Methods
addNode (line 24)

Creates a new node at $path.

The new node will be persisted immediately. Strictly speaking, the parameter is actually a relative path to the parent node of the node to be added, appended with the name desired for the new node (if the a node is being added directly below this node then only the name need be specified). An ItemExistsException will be thrown immediately if an item at the specified path already exists. A PathNotFoundException will be thrown immediately if the specified path implies intermediary nodes that do not exist.

  • return: the node that was added.
  • access: public
Node addNode (string $path)
  • string $path: the path of the new node to be created.
getNode (line 61)

Returns the node at $path relative to this node.

A PathNotFoundException will be thrown immediately if no node exists at the specified path.

  • return: the node at $path.
  • access: public
Node getNode (string $path)
  • string $path: the relative path of the node to retrieve.
getNodes (line 82)

Returns a NodeIterator over all child Nodes of this Node.

Does not include properties of this Node. The same reacquisition semantics apply as with getNode(String). If this node has no child nodes, then an empty iterator is returned.

  • return: all child Nodes of this Node.
  • access: public
NodeIterator getNodes ()
getProperties (line 96)

Returns all properties of this node.

Returns a PropertyIterator over all properties of this node. Does not include child nodes of this node. The same reacquisition semantics apply as with getProperty(String). If this node has no properties, then an empty iterator is returned.

  • return: all Properties of this Node.
  • access: public
PropertyIterator getProperties ()
getProperty (line 108)

Returns the property at $path relative to this node.

The same reacquisition semantics apply as with getNode(String).

  • return: the property at $path.
  • access: public
Property getProperty (string $path)
  • string $path: the relative path of the property to retrieve.
getReferences (line 134)

Returns all reference properties that refer to this node.

Returns a PropertyIterator over all properties that refer to this node. If this node is not referenced, then an empty iterator is returned.

  • return: all reference properties that refer to this Node.
  • access: public
PropertyIterator getReferences ()
hasNode (line 146)

Indicates whether a node exists at $path.

Returns true if a node exists at $path and false otherwise.

  • return: true if a node exists at $path; false otherwise.
  • access: public
boolean hasNode (string $path)
  • string $path: the path of a (possible) node.
hasNodes (line 163)

Indicates whether this node has child nodes.

Returns true if this node has one or more child nodes; false otherwise.

  • return: true if this node has one or more child nodes; false otherwise.
  • access: public
boolean hasNodes ()
hasProperties (line 174)

Indicates whether this node has properties.

Returns true if this node has one or more properties; false otherwise.

  • return: true if this node has one or more properties; false otherwise.
  • access: public
boolean hasProperties ()
hasProperty (line 186)

Indicates whether a property exists at $path.

Returns true if a property exists at $path and false otherwise.

  • return: true if a property exists at $path; false otherwise.
  • access: public
boolean hasProperty (string $path)
  • string $path: the path of a (possible) property.
hasReferences (line 209)

Indicates whether this node has been referenced.

Returns true if this node has been referenced; false otherwise.

  • return: true if this node has been referenced; false otherwise.
  • access: public
boolean hasReferences ()
isLocked (line 219)

Returns true if this node holds a lock; otherwise returns false.

To hold a lock means that this node has actually had a lock placed on it specifically.

  • access: public
void isLocked ()
lock (line 236)

Places a lock on this node.

If successful, this node is said to hold the lock. If this node is already locked, a LockException is thrown.

  • access: public
void lock ()
setProperty (line 259)

Sets the specified property to the specified value.

If the property does not yet exist, it is created. A best-effort data type conversion/persistence is attempted. Passing a null as the second parameter removes the property. It is equivalent to calling remove on the Property object itself. For example, N.setProperty("P", null) would remove property called "P" of the node in N. A LockException will be thrown immediately if a lock prevents the setting of the property.

  • return: the updated Property object.
  • access: public
Property setProperty (string $name, generic $value)
  • string $name: the name of a property of this node.
  • generic $value: the value to assigned.
unlock (line 306)

Removes the lock on this node.

These changes are persisted automatically. If this node does not currently hold a lock, then a LockException is thrown.

  • access: public
void unlock ()

Inherited Methods

Inherited From Item

 Item::__construct()
 Item::getAncestor()
 Item::getDepth()
 Item::getName()
 Item::getParent()
 Item::getPath()
 Item::isNode()
 Item::isSame()
 Item::remove()
 Item::toNode()
 Item::toProperty()

Documentation generated on Sun, 04 Oct 2009 07:13:10 +0800 by phpDocumentor 1.4.3