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