Esempio n. 1
0
 /**
  * Exchange the rank of the object with the one passed as argument, and saves both objects
  *
  * @param     ChildDeliveryPeriodic $object
  * @param     ConnectionInterface $con optional connection
  *
  * @return    $this|ChildDeliveryPeriodic the current object
  *
  * @throws Exception if the database cannot execute the two updates
  */
 public function swapWith($object, ConnectionInterface $con = null)
 {
     if (null === $con) {
         $con = Propel::getServiceContainer()->getWriteConnection(DeliveryPeriodicTableMap::DATABASE_NAME);
     }
     $con->transaction(function () use($con, $object) {
         $oldScope = $this->getScopeValue();
         $newScope = $object->getScopeValue();
         if ($oldScope != $newScope) {
             $this->setScopeValue($newScope);
             $object->setScopeValue($oldScope);
         }
         $oldRank = $this->getSortableRank();
         $newRank = $object->getSortableRank();
         $this->setSortableRank($newRank);
         $object->setSortableRank($oldRank);
         $this->save($con);
         $object->save($con);
     });
     return $this;
 }
Esempio n. 2
0
 /**
  * Filter the query by a related \App\Propel\DeliveryPeriodic object
  *
  * @param \App\Propel\DeliveryPeriodic|ObjectCollection $deliveryPeriodic the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildPeriodicPlanQuery The current query, for fluid interface
  */
 public function filterByDeliveryPeriodic($deliveryPeriodic, $comparison = null)
 {
     if ($deliveryPeriodic instanceof \App\Propel\DeliveryPeriodic) {
         return $this->addUsingAlias(PeriodicPlanTableMap::COL_PERIODIC_PLAN_ID, $deliveryPeriodic->getDeliveryPeriodicPlanId(), $comparison);
     } elseif ($deliveryPeriodic instanceof ObjectCollection) {
         return $this->useDeliveryPeriodicQuery()->filterByPrimaryKeys($deliveryPeriodic->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByDeliveryPeriodic() only accepts arguments of type \\App\\Propel\\DeliveryPeriodic or Collection');
     }
 }
Esempio n. 3
0
 /**
  * @param ChildDeliveryPeriodic $deliveryPeriodic The ChildDeliveryPeriodic object to add.
  */
 protected function doAddDeliveryPeriodic(ChildDeliveryPeriodic $deliveryPeriodic)
 {
     $this->collDeliveryPeriodics[] = $deliveryPeriodic;
     $deliveryPeriodic->setPeriodicPlan($this);
 }
 /**
  * Exclude object from result
  *
  * @param   ChildDeliveryPeriodic $deliveryPeriodic Object to remove from the list of results
  *
  * @return $this|ChildDeliveryPeriodicQuery The current query, for fluid interface
  */
 public function prune($deliveryPeriodic = null)
 {
     if ($deliveryPeriodic) {
         $this->addUsingAlias(DeliveryPeriodicTableMap::COL_DELIVERY_PERIODIC_ID, $deliveryPeriodic->getDeliveryPeriodicId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }