propel-om
[ class tree: propel-om ] [ index: propel-om ] [ all elements ]

Source for file NodeObject.php

Documentation is available at NodeObject.php

  1. <?php
  2. /*
  3.  *  $Id: NodeObject.php 797 2007-11-09 19:21:21Z heltem $
  4.  *
  5.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  6.  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7.  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8.  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9.  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  11.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  12.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15.  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16.  *
  17.  * This software consists of voluntary contributions made by many individuals
  18.  * and is licensed under the LGPL. For more information please see
  19.  * <http://propel.phpdb.org>.
  20.  */
  21.  
  22. /**
  23.  * This interface defines methods that must be implemented by all
  24.  * business objects within the system to handle Node object.
  25.  *
  26.  * @author     Heltem <heltem@o2php.com> (Propel)
  27.  * @version    $Revision: 797 $
  28.  * @package    propel.om
  29.  */
  30. interface NodeObject extends IteratorAggregate {
  31.     /**
  32.      * If object is saved without left/right values, set them as undefined (0)
  33.      *
  34.      * @param      PropelPDO $con    Connection to use.
  35.      * @return     void 
  36.      * @throws     PropelException
  37.      */
  38.     public function save(PropelPDO $con null);
  39.  
  40.     /**
  41.      * Delete node and descendants
  42.      *
  43.      * @param      PropelPDO $con    Connection to use.
  44.      * @return     void 
  45.      * @throws     PropelException
  46.      */
  47.     public function delete(PropelPDO $con null);
  48.  
  49.     /**
  50.      * Sets node properties to make it a root node.
  51.      *
  52.      * @return     object The current object (for fluent API support)
  53.      * @throws     PropelException
  54.      */
  55.     public function makeRoot();
  56.  
  57.     /**
  58.      * Gets the level if set, otherwise calculates this and returns it
  59.      *
  60.      * @param      PropelPDO $con    Connection to use.
  61.      * @return     int 
  62.      */
  63.     public function getLevel(PropelPDO $con null);
  64.  
  65.     /**
  66.      * Get the path to the node in the tree
  67.      *
  68.      * @param      PropelPDO $con    Connection to use.
  69.      * @return     array 
  70.      */
  71.     public function getPath(PropelPDO $con null);
  72.  
  73.     /**
  74.      * Gets the number of children for the node (direct descendants)
  75.      *
  76.      * @param      PropelPDO $con    Connection to use.
  77.      * @return     int 
  78.      */
  79.     public function getNumberOfChildren(PropelPDO $con null);
  80.  
  81.     /**
  82.      * Gets the total number of desceandants for the node
  83.      *
  84.      * @param      PropelPDO $con    Connection to use.
  85.      * @return     int 
  86.      */
  87.     public function getNumberOfDescendants(PropelPDO $con null);
  88.  
  89.     /**
  90.      * Gets the children for the node
  91.      *
  92.      * @param      PropelPDO $con    Connection to use.
  93.      * @return     array 
  94.      */
  95.     public function getChildren(PropelPDO $con null);
  96.  
  97.     /**
  98.      * Gets the descendants for the node
  99.      *
  100.      * @param      PropelPDO $con    Connection to use.
  101.       * @return     array 
  102.      */
  103.     public function getDescendants(PropelPDO $con null);
  104.  
  105.     /**
  106.      * Sets the level of the node in the tree
  107.      *
  108.      * @param      int $v new value
  109.      * @return     object The current object (for fluent API support)
  110.      */
  111.     public function setLevel($level);
  112.  
  113.     /**
  114.      * Sets the children array of the node in the tree
  115.      *
  116.      * @param      array of Node $children    array of Propel node object
  117.      * @return     object The current object (for fluent API support)
  118.      */
  119.     public function setChildren(array $children);
  120.  
  121.     /**
  122. /**
  123.      * Sets the parentNode of the node in the tree
  124.      *
  125.      * @param      Node $parent Propel node object
  126.      * @return     object The current object (for fluent API support)
  127.      */
  128.     public function setParentNode(NodeObject $parent null);
  129.  
  130.     /**
  131.      * Sets the previous sibling of the node in the tree
  132.      *
  133.      * @param      Node $node Propel node object
  134.      * @return     object The current object (for fluent API support)
  135.      */
  136.     public function setPrevSibling(NodeObject $node null);
  137.  
  138.     /**
  139.      * Sets the next sibling of the node in the tree
  140.      *
  141.      * @param      Node $node Propel node object
  142.      * @return     object The current object (for fluent API support)
  143.      */
  144.     public function setNextSibling(NodeObject $node null);
  145.  
  146.     /**
  147.      * Determines if the node is the root node
  148.      *
  149.      * @return     bool 
  150.      */
  151.     public function isRoot();
  152.  
  153.     /**
  154.      * Determines if the node is a leaf node
  155.      *
  156.      * @return     bool 
  157.      */
  158.     public function isLeaf();
  159.  
  160.     /**
  161.      * Tests if object is equal to $node
  162.      *
  163.      * @param      object $node    Propel object for node to compare to
  164.      * @return     bool 
  165.      */
  166.     public function isEqualTo(NodeObject $node);
  167.  
  168.     /**
  169.      * Tests if object has an ancestor
  170.      *
  171.      * @param      PropelPDO $con    Connection to use.
  172.      * @return     bool 
  173.      */
  174.     public function hasParent(PropelPDO $con null);
  175.  
  176.     /**
  177.      * Determines if the node has children / descendants
  178.      *
  179.      * @return     bool 
  180.      */
  181.     public function hasChildren();
  182.  
  183.     /**
  184.      * Determines if the node has previous sibling
  185.      *
  186.      * @param      PropelPDO $con    Connection to use.
  187.      * @return     bool 
  188.      */
  189.     public function hasPrevSibling(PropelPDO $con null);
  190.  
  191.     /**
  192.      * Determines if the node has next sibling
  193.      *
  194.      * @param      PropelPDO $con    Connection to use.
  195.      * @return     bool 
  196.      */
  197.     public function hasNextSibling(PropelPDO $con null);
  198.  
  199.     /**
  200.      * Gets ancestor for the given node if it exists
  201.      *
  202.      * @param      PropelPDO $con    Connection to use.
  203.      * @return     mixed         Propel object if exists else false
  204.      */
  205.     public function retrieveParent(PropelPDO $con null);
  206.  
  207.     /**
  208.      * Gets first child if it exists
  209.      *
  210.      * @param      PropelPDO $con    Connection to use.
  211.      * @return     mixed         Propel object if exists else false
  212.      */
  213.     public function retrieveFirstChild(PropelPDO $con null);
  214.  
  215.     /**
  216.      * Gets last child if it exists
  217.      *
  218.      * @param      PropelPDO $con    Connection to use.
  219.      * @return     mixed         Propel object if exists else false
  220.      */
  221.     public function retrieveLastChild(PropelPDO $con null);
  222.  
  223.     /**
  224.      * Gets prev sibling for the given node if it exists
  225.      *
  226.      * @param      PropelPDO $con    Connection to use.
  227.      * @return     mixed         Propel object if exists else false
  228.      */
  229.     public function retrievePrevSibling(PropelPDO $con null);
  230.  
  231.     /**
  232.      * Gets next sibling for the given node if it exists
  233.      *
  234.      * @param      PropelPDO $con    Connection to use.
  235.      * @return     mixed         Propel object if exists else false
  236.      */
  237.     public function retrieveNextSibling(PropelPDO $con null);
  238.  
  239.     /**
  240.      * Inserts as first child of destination node $parent
  241.      *
  242.      * @param      object $parent    Propel object for given destination node
  243.      * @param      PropelPDO $con    Connection to use.
  244.      * @return     object The current object (for fluent API support)
  245.      */
  246.     public function insertAsFirstChildOf(NodeObject $parentPropelPDO $con null);
  247.  
  248.     /**
  249.      * Inserts as last child of destination node $parent
  250.      *
  251.      * @param      object $parent    Propel object for given destination node
  252.      * @param      PropelPDO $con    Connection to use.
  253.      * @return     object The current object (for fluent API support)
  254.      */
  255.     public function insertAsLastChildOf(NodeObject $parentPropelPDO $con null);
  256.  
  257.     /**
  258.      * Inserts node as previous sibling to destination node $dest
  259.      *
  260.      * @param      object $dest    Propel object for given destination node
  261.      * @param      PropelPDO $con    Connection to use.
  262.      * @return     object The current object (for fluent API support)
  263.      */
  264.     public function insertAsPrevSiblingOf(NodeObject $destPropelPDO $con null);
  265.  
  266.     /**
  267.      * Inserts node as next sibling to destination node $dest
  268.      *
  269.      * @param      object $dest    Propel object for given destination node
  270.      * @param      PropelPDO $con    Connection to use.
  271.      * @return     object The current object (for fluent API support)
  272.      */
  273.     public function insertAsNextSiblingOf(NodeObject $destPropelPDO $con null);
  274.  
  275.     /**
  276.      * Moves node to be first child of $parent
  277.      *
  278.      * @param      object $parent    Propel object for destination node
  279.      * @param      PropelPDO $con Connection to use.
  280.      * @return     void 
  281.      */
  282.     public function moveToFirstChildOf(NodeObject $parentPropelPDO $con null);
  283.  
  284.     /**
  285.      * Moves node to be last child of $parent
  286.      *
  287.      * @param      object $parent    Propel object for destination node
  288.      * @param      PropelPDO $con Connection to use.
  289.      * @return     void 
  290.      */
  291.     public function moveToLastChildOf(NodeObject $parentPropelPDO $con null);
  292.  
  293.     /**
  294.      * Moves node to be prev sibling to $dest
  295.      *
  296.      * @param      object $dest    Propel object for destination node
  297.      * @param      PropelPDO $con Connection to use.
  298.      * @return     void 
  299.      */
  300.     public function moveToPrevSiblingOf(NodeObject $destPropelPDO $con null);
  301.  
  302.     /**
  303.      * Moves node to be next sibling to $dest
  304.      *
  305.      * @param      object $dest    Propel object for destination node
  306.      * @param      PropelPDO $con Connection to use.
  307.      * @return     void 
  308.      */
  309.     public function moveToNextSiblingOf(NodeObject $destPropelPDO $con null);
  310.  
  311.     /**
  312.      * Inserts node as parent of given node.
  313.      *
  314.      * @param      object $node  Propel object for given destination node
  315.      * @param      PropelPDO $con    Connection to use.
  316.      * @return     void 
  317.      * @throws     Exception      When trying to insert node as parent of a root node
  318.      */
  319.     public function insertAsParentOf(NodeObject $nodePropelPDO $con null);
  320.  
  321.     /**
  322.      * Wraps the getter for the scope value
  323.      *
  324.      * @return     int 
  325.      */
  326.     public function getScopeIdValue();
  327.  
  328.     /**
  329.      * Set the value of scope column
  330.      *
  331.      * @param      int $v new value
  332.      * @return     object The current object (for fluent API support)
  333.      */
  334.     public function setScopeIdValue($v);
  335. // NodeObject

Documentation generated on Thu, 22 Nov 2007 03:33:46 +0000 by phpDocumentor 1.4.0