Exemplo n.º 1
0
 /**
  * Sets the properties of the current object to the value they had at a specific version
  *
  * @param ChildOrderVersion $version The version object to use
  * @param ConnectionInterface   $con the connection to use
  * @param array                 $loadedObjects objects that been loaded in a chain of populateFromVersion calls on referrer or fk objects.
  *
  * @return ChildOrder The current object (for fluent API support)
  */
 public function populateFromVersion($version, $con = null, &$loadedObjects = array())
 {
     $loadedObjects['ChildOrder'][$version->getId()][$version->getVersion()] = $this;
     $this->setId($version->getId());
     $this->setRef($version->getRef());
     $this->setCustomerId($version->getCustomerId());
     $this->setInvoiceOrderAddressId($version->getInvoiceOrderAddressId());
     $this->setDeliveryOrderAddressId($version->getDeliveryOrderAddressId());
     $this->setInvoiceDate($version->getInvoiceDate());
     $this->setCurrencyId($version->getCurrencyId());
     $this->setCurrencyRate($version->getCurrencyRate());
     $this->setTransactionRef($version->getTransactionRef());
     $this->setDeliveryRef($version->getDeliveryRef());
     $this->setInvoiceRef($version->getInvoiceRef());
     $this->setDiscount($version->getDiscount());
     $this->setPostage($version->getPostage());
     $this->setPostageTax($version->getPostageTax());
     $this->setPostageTaxRuleTitle($version->getPostageTaxRuleTitle());
     $this->setPaymentModuleId($version->getPaymentModuleId());
     $this->setDeliveryModuleId($version->getDeliveryModuleId());
     $this->setStatusId($version->getStatusId());
     $this->setLangId($version->getLangId());
     $this->setCartId($version->getCartId());
     $this->setCreatedAt($version->getCreatedAt());
     $this->setUpdatedAt($version->getUpdatedAt());
     $this->setVersion($version->getVersion());
     $this->setVersionCreatedAt($version->getVersionCreatedAt());
     $this->setVersionCreatedBy($version->getVersionCreatedBy());
     if ($fkValue = $version->getCustomerId()) {
         if (isset($loadedObjects['ChildCustomer']) && isset($loadedObjects['ChildCustomer'][$fkValue]) && isset($loadedObjects['ChildCustomer'][$fkValue][$version->getCustomerIdVersion()])) {
             $related = $loadedObjects['ChildCustomer'][$fkValue][$version->getCustomerIdVersion()];
         } else {
             $related = new ChildCustomer();
             $relatedVersion = ChildCustomerVersionQuery::create()->filterById($fkValue)->filterByVersion($version->getCustomerIdVersion())->findOne($con);
             $related->populateFromVersion($relatedVersion, $con, $loadedObjects);
             $related->setNew(false);
         }
         $this->setCustomer($related);
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database. In some cases you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by find*()
  * and findPk*() calls.
  *
  * @param \Thelia\Model\OrderVersion $obj A \Thelia\Model\OrderVersion object.
  * @param string $key             (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if (null === $key) {
             $key = serialize(array((string) $obj->getId(), (string) $obj->getVersion()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Exemplo n.º 3
0
 /**
  * Exclude object from result
  *
  * @param   ChildOrderVersion $orderVersion Object to remove from the list of results
  *
  * @return ChildOrderVersionQuery The current query, for fluid interface
  */
 public function prune($orderVersion = null)
 {
     if ($orderVersion) {
         $this->addCond('pruneCond0', $this->getAliasedColName(OrderVersionTableMap::ID), $orderVersion->getId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(OrderVersionTableMap::VERSION), $orderVersion->getVersion(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
Exemplo n.º 4
0
 /**
  * Filter the query by a related \Thelia\Model\OrderVersion object
  *
  * @param \Thelia\Model\OrderVersion|ObjectCollection $orderVersion  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildOrderQuery The current query, for fluid interface
  */
 public function filterByOrderVersion($orderVersion, $comparison = null)
 {
     if ($orderVersion instanceof \Thelia\Model\OrderVersion) {
         return $this->addUsingAlias(OrderTableMap::ID, $orderVersion->getId(), $comparison);
     } elseif ($orderVersion instanceof ObjectCollection) {
         return $this->useOrderVersionQuery()->filterByPrimaryKeys($orderVersion->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByOrderVersion() only accepts arguments of type \\Thelia\\Model\\OrderVersion or Collection');
     }
 }