[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/propel-generator/templates/om/php5/ -> Node.tpl (sommaire)

Base tree node class for manipulating a tree of <?php echo $table->getPhpName() ?> objects. This class will wrap these objects within a "node" interface. It provides a method overload mechanism which allows you to use a <?php echo $table->getPhpName() ?>Node object just like a <?php $table->getPhpName() ?> object. To avoid tree corruption, you should always use this class to make changes to the tree and objects within it rather than using the <?php echo $table->getPhpName() ?> class directly.

Poids: 801 lignes (28 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 31 fonctions

  __construct()
  __call()
  setIteratorOptions()
  getIterator()
  getNodeObj()
  getNodePath()
  getNodeIndex()
  getNodeLevel()
  hasChildNode()
  getChildNodeAt()
  getFirstChildNode()
  getLastChildNode()
  getSiblingNode()
  getParentNode()
  getAncestors()
  isRootNode()
  setNew()
  setDeleted()
  addChildNode()
  moveChildNode()
  save()
  delete()
  equals()
  attachParentNode()
  attachChildNode()
  detachParentNode()
  detachChildNode()
  shiftChildNodes()
  insertNewChildNode()
  adjustStatus()
  adjustNodePath()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

__construct($obj = null)   X-Ref
Constructor.

param: <?php echo $table->getPhpName() ?> Object wrapped by this node.

__call($name, $parms)   X-Ref
Convenience overload for wrapped object methods.

param: string Method name to call on wrapped object.
param: mixed Parameter accepted by wrapped object set method.
return: mixed Return value of wrapped object method.

setIteratorOptions($type, $opts)   X-Ref
Sets the default options for iterators created from this object.
The options are specified in map format. The following options
are supported by all iterators. Some iterators may support other
options:

"querydb" - True if nodes should be retrieved from database.
"con" - Connection to use if retrieving from database.

param: string Type of iterator to use ("pre", "post", "level").
param: array Map of option name => value.
return: void

getIterator($type = null, $opts = null)   X-Ref
Returns a pre-order iterator for this node and its children.

param: string Type of iterator to use ("pre", "post", "level")
param: array Map of option name => value.
return: NodeIterator

getNodeObj()   X-Ref
Returns the object wrapped by this class.

return: <?php echo $table->getPhpName() . "\n" ?>

getNodePath()   X-Ref
Convenience method for retrieving nodepath.

return: string

getNodeIndex()   X-Ref
Returns one-based node index among siblings.

return: int

getNodeLevel()   X-Ref
Returns one-based node level within tree (root node is level 1).

return: int

hasChildNode($node, $strict = false, $recurse = false)   X-Ref
Returns true if specified node is a child of this node. If recurse is
true, checks if specified node is a descendant of this node.

param: <?php echo $table->getPhpName() ?>Node Node to look for.
param: boolean True if strict comparison should be used.
param: boolean True if all descendants should be checked.
return: boolean

getChildNodeAt($i, $querydb = false, $con = null)   X-Ref
Returns child node at one-based index. Retrieves from database if not
loaded yet.

param: int One-based child node index.
param: boolean True if child should be retrieved from database.
param: Connection Connection to use if retrieving from database.
return: <?php echo $table->getPhpName() ?>Node

getFirstChildNode($querydb = false, $con = null)   X-Ref
Returns first child node (if any). Retrieves from database if not loaded yet.

param: boolean True if child should be retrieved from database.
param: Connection Connection to use if retrieving from database.
return: <?php echo $table->getPhpName() ?>Node

getLastChildNode($querydb = false, $con = null)   X-Ref
Returns last child node (if any).

param: boolean True if child should be retrieved from database.
param: Connection Connection to use if retrieving from database.

getSiblingNode($prev = false, $querydb = false, $con = null)   X-Ref
Returns next (or previous) sibling node or null. Retrieves from database if
not loaded yet.

param: boolean True if previous sibling should be returned.
param: boolean True if sibling should be retrieved from database.
param: Connection Connection to use if retrieving from database.
return: <?php echo $table->getPhpName() ?>Node

getParentNode($querydb = true, $con = null)   X-Ref
Returns parent node. Loads from database if not cached yet.

param: boolean True if parent should be retrieved from database.
param: Connection Connection to use if retrieving from database.
return: <?php echo $table->getPhpName() ?>Node

getAncestors($querydb = false, $con = null)   X-Ref
Returns an array of all ancestor nodes, starting with the root node
first.

param: boolean True if ancestors should be retrieved from database.
param: Connection Connection to use if retrieving from database.
return: array

isRootNode()   X-Ref
Returns true if node is the root node of the tree.

return: boolean

setNew($b)   X-Ref
Changes the state of the object and its descendants to 'new'.
Also changes the node path to '0' to indicate that it is not a
stored node.

param: boolean
return: void

setDeleted($b)   X-Ref
Changes the state of the object and its descendants to 'deleted'.

param: boolean
return: void

addChildNode($node, $beforeNode = null, $con = null)   X-Ref
Adds the specified node (and its children) as a child to this node. If a
valid $beforeNode is specified, the node will be inserted in front of
$beforeNode. If $beforeNode is not specified the node will be appended to
the end of the child nodes.

param: <?php echo $table->getPhpName() ?>Node Node to add.
param: <?php echo $table->getPhpName() ?>Node Node to insert before.
param: Connection Connection to use.

moveChildNode($node, $direction, $con = null)   X-Ref
Moves the specified child node in the specified direction.

param: <?php $table->getPhpName() ?>Node Node to move.
param: int Number of spaces to move among siblings (may be negative).
param: Connection Connection to use.

save($recurse = false, $con = null)   X-Ref
Saves modified object data to the datastore.

param: boolean If true, descendants will be saved as well.
param: Connection Connection to use.

delete($con = null)   X-Ref
Removes this object and all descendants from datastore.

param: Connection Connection to use.
return: void

equals($node, $strict = false)   X-Ref
Compares the object wrapped by this node with that of another node. Use
this instead of equality operators to prevent recursive dependency
errors.

param: <?php echo $table->getPhpName() ?>Node Node to compare.
param: boolean True if strict comparison should be used.
return: boolean

attachParentNode($node)   X-Ref
This method is used internally when constructing the tree structure
from the database. To set the parent of a node, you should call
addChildNode() on the parent.

param: <?php echo $table->getPhpName() ?>Node Parent node to attach.
return: void

attachChildNode($node)   X-Ref
This method is used internally when constructing the tree structure
from the database. To add a child to a node you should call the
addChildNode() method instead.

param: <?php echo $table->getPhpName() ?>Node Child node to attach.
return: void

detachParentNode($node)   X-Ref
This method is used internally when deleting nodes. It is used to break
the link to this node's parent.

param: <?php echo $table->getPhpName() ?>Node Parent node to detach from.
return: void

detachChildNode($node)   X-Ref
This method is used internally when deleting nodes. It is used to break
the link to this between this node and the specified child.

param: <?php echo $table->getPhpName() ?>Node Child node to detach.
return: void

shiftChildNodes($direction, $offsetIdx, $con)   X-Ref
Shifts child nodes in the specified direction and offset index. This
method assumes that there is already space available in the
direction/offset indicated.

param: int Direction/# spaces to shift. 1=leftshift, 1=rightshift
param: int Node index to start shift at.
param: Connection The connection to be used.
return: void

insertNewChildNode($node, $childIdx, $con)   X-Ref
Inserts the node and its children at the specified childIdx.

param: <?php echo $table->getPhpName() ?>Node Node to insert.
param: int One-based child index to insert at.
param: Connection Connection to use.
param: void

adjustStatus($status, $b)   X-Ref
Adjust new/deleted status of node and all children.

param: string Status to change ('New' or 'Deleted')
param: boolean Value for status.
return: void

adjustNodePath($oldBasePath, $newBasePath)   X-Ref
Adjust path of node and all children. This is used internally when
inserting/moving nodes.

param: string Section of old path to change.
param: string New section to replace old path with.
return: void



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7