Example #1
0
 public function addArea(ShippingZoneAddAreaEvent $event)
 {
     $areaDelivery = new AreaDeliveryModule();
     $areaDelivery->setAreaId($event->getAreaId())->setDeliveryModuleId($event->getShippingZoneId())->save();
 }
 /**
  * Exclude object from result
  *
  * @param   ChildAreaDeliveryModule $areaDeliveryModule Object to remove from the list of results
  *
  * @return ChildAreaDeliveryModuleQuery The current query, for fluid interface
  */
 public function prune($areaDeliveryModule = null)
 {
     if ($areaDeliveryModule) {
         $this->addUsingAlias(AreaDeliveryModuleTableMap::ID, $areaDeliveryModule->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Example #3
0
 /**
  * Filter the query by a related \Thelia\Model\AreaDeliveryModule object
  *
  * @param \Thelia\Model\AreaDeliveryModule|ObjectCollection $areaDeliveryModule  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildAreaQuery The current query, for fluid interface
  */
 public function filterByAreaDeliveryModule($areaDeliveryModule, $comparison = null)
 {
     if ($areaDeliveryModule instanceof \Thelia\Model\AreaDeliveryModule) {
         return $this->addUsingAlias(AreaTableMap::ID, $areaDeliveryModule->getAreaId(), $comparison);
     } elseif ($areaDeliveryModule instanceof ObjectCollection) {
         return $this->useAreaDeliveryModuleQuery()->filterByPrimaryKeys($areaDeliveryModule->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByAreaDeliveryModule() only accepts arguments of type \\Thelia\\Model\\AreaDeliveryModule or Collection');
     }
 }