/** * Filter the query by a related \Thelia\Model\Tax object * * @param \Thelia\Model\Tax|ObjectCollection $tax The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildTaxRuleCountryQuery The current query, for fluid interface */ public function filterByTax($tax, $comparison = null) { if ($tax instanceof \Thelia\Model\Tax) { return $this->addUsingAlias(TaxRuleCountryTableMap::TAX_ID, $tax->getId(), $comparison); } elseif ($tax instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(TaxRuleCountryTableMap::TAX_ID, $tax->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByTax() only accepts arguments of type \\Thelia\\Model\\Tax or Collection'); } }