Example #1
0
 /**
  * Filter the query by a related \Thelia\Model\State object
  *
  * @param \Thelia\Model\State|ObjectCollection $state  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildCountryQuery The current query, for fluid interface
  */
 public function filterByState($state, $comparison = null)
 {
     if ($state instanceof \Thelia\Model\State) {
         return $this->addUsingAlias(CountryTableMap::ID, $state->getCountryId(), $comparison);
     } elseif ($state instanceof ObjectCollection) {
         return $this->useStateQuery()->filterByPrimaryKeys($state->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByState() only accepts arguments of type \\Thelia\\Model\\State or Collection');
     }
 }