/**
  * Tests if $node has an ancestor
  *
  * @param      sfBreadNav $node		Propel object for node
  * @param      PropelPDO $con		Connection to use.
  * @return     bool
  */
 public static function hasParent(NodeObject $node, PropelPDO $con = null)
 {
     return sfBreadNavPeer::isValid(sfBreadNavPeer::retrieveParent($node, $con));
 }
示例#2
0
 /**
  * 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)
 {
     if (null === $this->hasParentNode) {
         $this->parentNode = sfBreadNavPeer::retrieveParent($this, $con);
         $this->hasParentNode = sfBreadNavPeer::isValid($this->parentNode);
     }
     return $this->parentNode;
 }