/** * Exclude object from result * * @param ChildCouponModule $couponModule Object to remove from the list of results * * @return ChildCouponModuleQuery The current query, for fluid interface */ public function prune($couponModule = null) { if ($couponModule) { $this->addCond('pruneCond0', $this->getAliasedColName(CouponModuleTableMap::COUPON_ID), $couponModule->getCouponId(), Criteria::NOT_EQUAL); $this->addCond('pruneCond1', $this->getAliasedColName(CouponModuleTableMap::MODULE_ID), $couponModule->getModuleId(), Criteria::NOT_EQUAL); $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR); } return $this; }
/** * @param Coupon $coupon The coupon object to add. */ protected function doAddCoupon($coupon) { $couponModule = new ChildCouponModule(); $couponModule->setCoupon($coupon); $this->addCouponModule($couponModule); // set the back reference to this object directly as using provided method either results // in endless loop or in multiple relations if (!$coupon->getModules()->contains($this)) { $foreignCollection = $coupon->getModules(); $foreignCollection[] = $this; } }
/** * Filter the query by a related \Thelia\Model\CouponModule object * * @param \Thelia\Model\CouponModule|ObjectCollection $couponModule 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 filterByCouponModule($couponModule, $comparison = null) { if ($couponModule instanceof \Thelia\Model\CouponModule) { return $this->addUsingAlias(CouponTableMap::ID, $couponModule->getCouponId(), $comparison); } elseif ($couponModule instanceof ObjectCollection) { return $this->useCouponModuleQuery()->filterByPrimaryKeys($couponModule->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByCouponModule() only accepts arguments of type \\Thelia\\Model\\CouponModule or Collection'); } }
/** * 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\CouponModule $obj A \Thelia\Model\CouponModule 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->getCouponId(), (string) $obj->getModuleId())); } // if key === null self::$instances[$key] = $obj; } }