123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <?php
- /**
- * This file is part of the Propel package.
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- *
- * @license MIT License
- */
- /**
- * This interface defines methods that must be implemented by all
- * business objects within the system to handle Node object.
- *
- * @author Heltem <heltem@o2php.com> (Propel)
- * @version $Revision: 1612 $
- * @package propel.runtime.om
- */
- interface NodeObject extends IteratorAggregate
- {
- /**
- * If object is saved without left/right values, set them as undefined (0)
- *
- * @param PropelPDO $con Connection to use.
- * @return void
- * @throws PropelException
- */
- public function save(PropelPDO $con = null);
- /**
- * Delete node and descendants
- *
- * @param PropelPDO $con Connection to use.
- * @return void
- * @throws PropelException
- */
- public function delete(PropelPDO $con = null);
- /**
- * Sets node properties to make it a root node.
- *
- * @return object The current object (for fluent API support)
- * @throws PropelException
- */
- public function makeRoot();
- /**
- * Gets the level if set, otherwise calculates this and returns it
- *
- * @param PropelPDO $con Connection to use.
- * @return int
- */
- public function getLevel(PropelPDO $con = null);
- /**
- * Get the path to the node in the tree
- *
- * @param PropelPDO $con Connection to use.
- * @return array
- */
- public function getPath(PropelPDO $con = null);
- /**
- * Gets the number of children for the node (direct descendants)
- *
- * @param PropelPDO $con Connection to use.
- * @return int
- */
- public function getNumberOfChildren(PropelPDO $con = null);
- /**
- * Gets the total number of desceandants for the node
- *
- * @param PropelPDO $con Connection to use.
- * @return int
- */
- public function getNumberOfDescendants(PropelPDO $con = null);
- /**
- * Gets the children for the node
- *
- * @param PropelPDO $con Connection to use.
- * @return array
- */
- public function getChildren(PropelPDO $con = null);
- /**
- * Gets the descendants for the node
- *
- * @param PropelPDO $con Connection to use.
- * @return array
- */
- public function getDescendants(PropelPDO $con = null);
- /**
- * Sets the level of the node in the tree
- *
- * @param int $v new value
- * @return object The current object (for fluent API support)
- */
- public function setLevel($level);
- /**
- * Sets the children array of the node in the tree
- *
- * @param array of Node $children array of Propel node object
- * @return object The current object (for fluent API support)
- */
- public function setChildren(array $children);
- /**
- * Sets the parentNode of the node in the tree
- *
- * @param Node $parent Propel node object
- * @return object The current object (for fluent API support)
- */
- public function setParentNode(NodeObject $parent = null);
- /**
- * Sets the previous sibling of the node in the tree
- *
- * @param Node $node Propel node object
- * @return object The current object (for fluent API support)
- */
- public function setPrevSibling(NodeObject $node = null);
- /**
- * Sets the next sibling of the node in the tree
- *
- * @param Node $node Propel node object
- * @return object The current object (for fluent API support)
- */
- public function setNextSibling(NodeObject $node = null);
- /**
- * Determines if the node is the root node
- *
- * @return bool
- */
- public function isRoot();
- /**
- * Determines if the node is a leaf node
- *
- * @return bool
- */
- public function isLeaf();
- /**
- * Tests if object is equal to $node
- *
- * @param object $node Propel object for node to compare to
- * @return bool
- */
- public function isEqualTo(NodeObject $node);
- /**
- * Tests if object has an ancestor
- *
- * @param PropelPDO $con Connection to use.
- * @return bool
- */
- public function hasParent(PropelPDO $con = null);
- /**
- * Determines if the node has children / descendants
- *
- * @return bool
- */
- public function hasChildren();
- /**
- * Determines if the node has previous sibling
- *
- * @param PropelPDO $con Connection to use.
- * @return bool
- */
- public function hasPrevSibling(PropelPDO $con = null);
- /**
- * Determines if the node has next sibling
- *
- * @param PropelPDO $con Connection to use.
- * @return bool
- */
- public function hasNextSibling(PropelPDO $con = null);
- /**
- * Gets ancestor for the given node if it exists
- *
- * @param PropelPDO $con Connection to use.
- * @return mixed Propel object if exists else false
- */
- public function retrieveParent(PropelPDO $con = null);
- /**
- * Gets first child if it exists
- *
- * @param PropelPDO $con Connection to use.
- * @return mixed Propel object if exists else false
- */
- public function retrieveFirstChild(PropelPDO $con = null);
- /**
- * Gets last child if it exists
- *
- * @param PropelPDO $con Connection to use.
- * @return mixed Propel object if exists else false
- */
- public function retrieveLastChild(PropelPDO $con = null);
- /**
- * Gets prev sibling for the given node if it exists
- *
- * @param PropelPDO $con Connection to use.
- * @return mixed Propel object if exists else false
- */
- public function retrievePrevSibling(PropelPDO $con = null);
- /**
- * Gets next sibling for the given node if it exists
- *
- * @param PropelPDO $con Connection to use.
- * @return mixed Propel object if exists else false
- */
- public function retrieveNextSibling(PropelPDO $con = null);
- /**
- * Inserts as first child of destination node $parent
- *
- * @param object $parent Propel object for given destination node
- * @param PropelPDO $con Connection to use.
- * @return object The current object (for fluent API support)
- */
- public function insertAsFirstChildOf(NodeObject $parent, PropelPDO $con = null);
- /**
- * Inserts as last child of destination node $parent
- *
- * @param object $parent Propel object for given destination node
- * @param PropelPDO $con Connection to use.
- * @return object The current object (for fluent API support)
- */
- public function insertAsLastChildOf(NodeObject $parent, PropelPDO $con = null);
- /**
- * Inserts node as previous sibling to destination node $dest
- *
- * @param object $dest Propel object for given destination node
- * @param PropelPDO $con Connection to use.
- * @return object The current object (for fluent API support)
- */
- public function insertAsPrevSiblingOf(NodeObject $dest, PropelPDO $con = null);
- /**
- * Inserts node as next sibling to destination node $dest
- *
- * @param object $dest Propel object for given destination node
- * @param PropelPDO $con Connection to use.
- * @return object The current object (for fluent API support)
- */
- public function insertAsNextSiblingOf(NodeObject $dest, PropelPDO $con = null);
- /**
- * Moves node to be first child of $parent
- *
- * @param object $parent Propel object for destination node
- * @param PropelPDO $con Connection to use.
- * @return void
- */
- public function moveToFirstChildOf(NodeObject $parent, PropelPDO $con = null);
- /**
- * Moves node to be last child of $parent
- *
- * @param object $parent Propel object for destination node
- * @param PropelPDO $con Connection to use.
- * @return void
- */
- public function moveToLastChildOf(NodeObject $parent, PropelPDO $con = null);
- /**
- * Moves node to be prev sibling to $dest
- *
- * @param object $dest Propel object for destination node
- * @param PropelPDO $con Connection to use.
- * @return void
- */
- public function moveToPrevSiblingOf(NodeObject $dest, PropelPDO $con = null);
- /**
- * Moves node to be next sibling to $dest
- *
- * @param object $dest Propel object for destination node
- * @param PropelPDO $con Connection to use.
- * @return void
- */
- public function moveToNextSiblingOf(NodeObject $dest, PropelPDO $con = null);
- /**
- * Inserts node as parent of given node.
- *
- * @param object $node Propel object for given destination node
- * @param PropelPDO $con Connection to use.
- * @return void
- * @throws Exception When trying to insert node as parent of a root node
- */
- public function insertAsParentOf(NodeObject $node, PropelPDO $con = null);
- /**
- * Wraps the getter for the scope value
- *
- * @return int
- */
- public function getScopeIdValue();
- /**
- * Set the value of scope column
- *
- * @param int $v new value
- * @return object The current object (for fluent API support)
- */
- public function setScopeIdValue($v);
- } // NodeObject
|