示例#1
0
 public function importCustomOrderStatus()
 {
     // Assume Thelia status are the same up to ID #5
     $hdl = $this->t1db->query("select * from statut where id > ?", array(5));
     while ($hdl && ($statut = $this->t1db->fetch_object($hdl))) {
         $ct = new OrderStatus();
         $descs = $this->t1db->query_list("select * from statutdesc where statut = ? order by lang asc", array($statut->id));
         foreach ($descs as $desc) {
             $lang = $this->getT2Lang($desc->lang);
             $ct->setCode(strtolower($statut->nom))->setLocale($lang->getLocale())->setTitle($desc->titre)->setChapo($desc->chapo)->setDescription($desc->description)->save();
         }
     }
 }
示例#2
0
 /**
  * Declares an association between this object and a ChildOrderStatus object.
  *
  * @param                  ChildOrderStatus $v
  * @return                 \Thelia\Model\OrderStatusI18n The current object (for fluent API support)
  * @throws PropelException
  */
 public function setOrderStatus(ChildOrderStatus $v = null)
 {
     if ($v === null) {
         $this->setId(NULL);
     } else {
         $this->setId($v->getId());
     }
     $this->aOrderStatus = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildOrderStatus object, it will not be re-added.
     if ($v !== null) {
         $v->addOrderStatusI18n($this);
     }
     return $this;
 }
 /**
  * @param OrderStatusModel $orderStatus
  * @return OrderStatusUpdateEvent
  */
 public function getUpdateEvent(OrderStatusModel $orderStatus)
 {
     $event = new OrderStatusUpdateEvent($orderStatus->getId());
     $event->setLocale($orderStatus->getLocale())->setTitle($orderStatus->getTitle())->setChapo($orderStatus->getChapo())->setDescription($orderStatus->getDescription())->setPostscriptum($orderStatus->getPostscriptum())->setColor($orderStatus->getColor())->setCode($orderStatus->getCode());
     return $event;
 }
示例#4
0
 /**
  * Filter the query by a related \Thelia\Model\OrderStatus object
  *
  * @param \Thelia\Model\OrderStatus|ObjectCollection $orderStatus The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildOrderStatusI18nQuery The current query, for fluid interface
  */
 public function filterByOrderStatus($orderStatus, $comparison = null)
 {
     if ($orderStatus instanceof \Thelia\Model\OrderStatus) {
         return $this->addUsingAlias(OrderStatusI18nTableMap::ID, $orderStatus->getId(), $comparison);
     } elseif ($orderStatus instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(OrderStatusI18nTableMap::ID, $orderStatus->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByOrderStatus() only accepts arguments of type \\Thelia\\Model\\OrderStatus or Collection');
     }
 }
 /**
  * Exclude object from result
  *
  * @param   ChildOrderStatus $orderStatus Object to remove from the list of results
  *
  * @return ChildOrderStatusQuery The current query, for fluid interface
  */
 public function prune($orderStatus = null)
 {
     if ($orderStatus) {
         $this->addUsingAlias(OrderStatusTableMap::ID, $orderStatus->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 /**
  * Returns the object ID from the object
  *
  * @param OrderStatus $object
  *
  * @return int order status id
  */
 protected function getObjectId($object)
 {
     return $object->getId();
 }