/** * Filter the query by a related \Thelia\Model\Address object * * @param \Thelia\Model\Address|ObjectCollection $address the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildStateQuery The current query, for fluid interface */ public function filterByAddress($address, $comparison = null) { if ($address instanceof \Thelia\Model\Address) { return $this->addUsingAlias(StateTableMap::ID, $address->getStateId(), $comparison); } elseif ($address instanceof ObjectCollection) { return $this->useAddressQuery()->filterByPrimaryKeys($address->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByAddress() only accepts arguments of type \\Thelia\\Model\\Address or Collection'); } }