Ejemplo n.º 1
0
 /**
  * Exclude object from result
  *
  * @param   ChildCouponVersion $couponVersion Object to remove from the list of results
  *
  * @return ChildCouponVersionQuery The current query, for fluid interface
  */
 public function prune($couponVersion = null)
 {
     if ($couponVersion) {
         $this->addCond('pruneCond0', $this->getAliasedColName(CouponVersionTableMap::ID), $couponVersion->getId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(CouponVersionTableMap::VERSION), $couponVersion->getVersion(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Sets the properties of the current object to the value they had at a specific version
  *
  * @param ChildCouponVersion $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 ChildCoupon The current object (for fluent API support)
  */
 public function populateFromVersion($version, $con = null, &$loadedObjects = array())
 {
     $loadedObjects['ChildCoupon'][$version->getId()][$version->getVersion()] = $this;
     $this->setId($version->getId());
     $this->setCode($version->getCode());
     $this->setType($version->getType());
     $this->setSerializedEffects($version->getSerializedEffects());
     $this->setIsEnabled($version->getIsEnabled());
     $this->setExpirationDate($version->getExpirationDate());
     $this->setMaxUsage($version->getMaxUsage());
     $this->setIsCumulative($version->getIsCumulative());
     $this->setIsRemovingPostage($version->getIsRemovingPostage());
     $this->setIsAvailableOnSpecialOffers($version->getIsAvailableOnSpecialOffers());
     $this->setIsUsed($version->getIsUsed());
     $this->setSerializedConditions($version->getSerializedConditions());
     $this->setPerCustomerUsageCount($version->getPerCustomerUsageCount());
     $this->setCreatedAt($version->getCreatedAt());
     $this->setUpdatedAt($version->getUpdatedAt());
     $this->setVersion($version->getVersion());
     $this->setVersionCreatedAt($version->getVersionCreatedAt());
     $this->setVersionCreatedBy($version->getVersionCreatedBy());
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * Filter the query by a related \Thelia\Model\CouponVersion object
  *
  * @param \Thelia\Model\CouponVersion|ObjectCollection $couponVersion  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildCouponQuery The current query, for fluid interface
  */
 public function filterByCouponVersion($couponVersion, $comparison = null)
 {
     if ($couponVersion instanceof \Thelia\Model\CouponVersion) {
         return $this->addUsingAlias(CouponTableMap::ID, $couponVersion->getId(), $comparison);
     } elseif ($couponVersion instanceof ObjectCollection) {
         return $this->useCouponVersionQuery()->filterByPrimaryKeys($couponVersion->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByCouponVersion() only accepts arguments of type \\Thelia\\Model\\CouponVersion or Collection');
     }
 }
Ejemplo n.º 4
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\CouponVersion $obj A \Thelia\Model\CouponVersion 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;
     }
 }