Esempio n. 1
0
 /**
  * Declares an association between this object and a Causadiferido object.
  *
  * @param             Causadiferido $v
  * @return Agenda The current object (for fluent API support)
  * @throws PropelException
  */
 public function setCausadiferido(Causadiferido $v = null)
 {
     if ($v === null) {
         $this->setCausaDiferidoId(NULL);
     } else {
         $this->setCausaDiferidoId($v->getId());
     }
     $this->aCausadiferido = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Causadiferido object, it will not be re-added.
     if ($v !== null) {
         $v->addAgenda($this);
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * Filter the query by a related Causadiferido object
  *
  * @param   Causadiferido|PropelObjectCollection $causadiferido The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return   AgendaQuery The current query, for fluid interface
  * @throws   PropelException - if the provided filter is invalid.
  */
 public function filterByCausadiferido($causadiferido, $comparison = null)
 {
     if ($causadiferido instanceof Causadiferido) {
         return $this->addUsingAlias(AgendaPeer::CAUSA_DIFERIDO_ID, $causadiferido->getId(), $comparison);
     } elseif ($causadiferido instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(AgendaPeer::CAUSA_DIFERIDO_ID, $causadiferido->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByCausadiferido() only accepts arguments of type Causadiferido or PropelCollection');
     }
 }
Esempio n. 3
0
 /**
  * Moves current node and its subtree to be the next sibling of $sibling
  * The modifications in the current object and the tree are immediate
  *
  * @param      Causadiferido $sibling	Propel object for sibling node
  * @param      PropelPDO $con	Connection to use.
  *
  * @return     Causadiferido The current Propel object
  */
 public function moveToNextSiblingOf($sibling, PropelPDO $con = null)
 {
     if (!$this->isInTree()) {
         throw new PropelException('A Causadiferido object must be already in the tree to be moved. Use the insertAsNextSiblingOf() instead.');
     }
     if ($sibling->isRoot()) {
         throw new PropelException('Cannot move to next sibling of a root node.');
     }
     if ($sibling->getScopeValue() != $this->getScopeValue()) {
         throw new PropelException('Moving nodes across trees is not supported');
     }
     if ($sibling->isDescendantOf($this)) {
         throw new PropelException('Cannot move a node as sibling of one of its subtree nodes.');
     }
     $this->moveSubtreeTo($sibling->getRightValue() + 1, $sibling->getLevel() - $this->getLevel(), $con);
     return $this;
 }
 /**
  * Filter the query to restrict the result to roots of an object.
  * Same as ancestorsOf(), except that it includes the object passed as parameter in the result
  *
  * @param     Causadiferido $causadiferido The object to use for roots search
  *
  * @return    CausadiferidoQuery The current query, for fluid interface
  */
 public function rootsOf($causadiferido)
 {
     return $this->inTree($causadiferido->getScopeValue())->addUsingAlias(CausadiferidoPeer::LEFT_COL, $causadiferido->getLeftValue(), Criteria::LESS_EQUAL)->addUsingAlias(CausadiferidoPeer::RIGHT_COL, $causadiferido->getRightValue(), Criteria::GREATER_EQUAL);
 }
 /**
  * Reload all already loaded nodes to sync them with updated db
  *
  * @param      Causadiferido $prune		Object to prune from the update
  * @param      PropelPDO $con		Connection to use.
  */
 public static function updateLoadedNodes($prune = null, PropelPDO $con = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         $keys = array();
         foreach (CausadiferidoPeer::$instances as $obj) {
             if (!$prune || !$prune->equals($obj)) {
                 $keys[] = $obj->getPrimaryKey();
             }
         }
         if (!empty($keys)) {
             // We don't need to alter the object instance pool; we're just modifying these ones
             // already in the pool.
             $criteria = new Criteria(CausadiferidoPeer::DATABASE_NAME);
             $criteria->add(CausadiferidoPeer::ID, $keys, Criteria::IN);
             $stmt = CausadiferidoPeer::doSelectStmt($criteria, $con);
             while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
                 $key = CausadiferidoPeer::getPrimaryKeyHashFromRow($row, 0);
                 if (null !== ($object = CausadiferidoPeer::getInstanceFromPool($key))) {
                     $object->setLeftValue($row[6]);
                     $object->setRightValue($row[7]);
                     $object->setLevel($row[8]);
                     $object->clearNestedSetChildren();
                 }
             }
             $stmt->closeCursor();
         }
     }
 }