getId(), $country->getId(), ($state !== null) ? $state->getId() : 0 ); if (array_key_exists($key, self::$caches)) { return self::$caches[$key]; } $taxRuleQuery = TaxRuleCountryQuery::create() ->filterByCountry($country, Criteria::EQUAL) ->filterByTaxRuleId($taxRule->getId()); if (null !== $state) { $taxRuleCount = $taxRuleQuery ->filterByStateId($state->getId(), Criteria::EQUAL) ->count(); if (0 === $taxRuleCount) { $taxRuleQuery->filterByStateId(null, Criteria::EQUAL); } } $search = TaxQuery::create() ->filterByTaxRuleCountry($taxRuleQuery->find()) ->withColumn(TaxRuleCountryTableMap::POSITION, self::ALIAS_FOR_TAX_RULE_COUNTRY_POSITION) ->orderBy(self::ALIAS_FOR_TAX_RULE_COUNTRY_POSITION, Criteria::ASC); ; return self::$caches[$key] = $search->find(); } } // TaxRuleQuery