Exemplo n.º 1
0
 /**
  * Filter the query by a related \Thelia\Model\Module object
  *
  * @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildCouponModuleQuery The current query, for fluid interface
  */
 public function filterByModule($module, $comparison = null)
 {
     if ($module instanceof \Thelia\Model\Module) {
         return $this->addUsingAlias(CouponModuleTableMap::MODULE_ID, $module->getId(), $comparison);
     } elseif ($module instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(CouponModuleTableMap::MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByModule() only accepts arguments of type \\Thelia\\Model\\Module or Collection');
     }
 }