1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Thelia\Model; |
4
|
|
|
|
5
|
|
|
use Propel\Runtime\ActiveQuery\Criteria; |
6
|
|
|
use Thelia\Model\Base\TaxRuleQuery as BaseTaxRuleQuery; |
|
|
|
|
7
|
|
|
use Thelia\Model\Map\TaxRuleCountryTableMap; |
|
|
|
|
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Skeleton subclass for performing query and update operations on the 'tax_rule' table. |
11
|
|
|
* |
12
|
|
|
* |
13
|
|
|
* |
14
|
|
|
* You should add additional methods to this class to meet the |
15
|
|
|
* application requirements. This class will only be generated as |
16
|
|
|
* long as it does not already exist in the output directory. |
17
|
|
|
* |
18
|
|
|
*/ |
19
|
|
|
class TaxRuleQuery extends BaseTaxRuleQuery |
20
|
|
|
{ |
21
|
|
|
const ALIAS_FOR_TAX_RULE_COUNTRY_POSITION = 'taxRuleCountryPosition'; |
22
|
|
|
|
23
|
|
|
protected static $caches = []; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @param TaxRule $taxRule |
27
|
|
|
* @param Country $country |
28
|
|
|
* |
29
|
|
|
* @return array|mixed|\Propel\Runtime\Collection\ObjectCollection |
30
|
|
|
*/ |
31
|
|
|
public function getTaxCalculatorCollection(TaxRule $taxRule, Country $country = null, State $state = null) |
32
|
|
|
{ |
33
|
|
|
$key = sprintf( |
34
|
|
|
'%s-%s-%s', |
35
|
|
|
$taxRule->getId(), |
36
|
|
|
($country !== null) ? $country->getId() : 0, |
37
|
|
|
($state !== null) ? $state->getId() : 0 |
38
|
|
|
); |
39
|
|
|
|
40
|
|
|
if (array_key_exists($key, self::$caches)) { |
41
|
|
|
return self::$caches[$key]; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
$taxRuleQuery = TaxRuleCountryQuery::create() |
45
|
|
|
->filterByTaxRuleId($taxRule->getId()); |
46
|
|
|
|
47
|
|
|
if (null !== $country) { |
48
|
|
|
$taxRuleQuery->filterByCountry($country, Criteria::EQUAL); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
if (null !== $state) { |
52
|
|
|
$taxRuleCount = clone $taxRuleQuery; |
53
|
|
|
|
54
|
|
|
$taxRuleCount->filterByStateId($state->getId(), Criteria::EQUAL) |
55
|
|
|
->count(); |
56
|
|
|
|
57
|
|
|
if (0 === $taxRuleCount) { |
|
|
|
|
58
|
|
|
$taxRuleQuery->filterByStateId(null, Criteria::EQUAL); |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
$search = TaxQuery::create() |
63
|
|
|
->filterByTaxRuleCountry($taxRuleQuery->find()) |
64
|
|
|
->withColumn(TaxRuleCountryTableMap::COL_POSITION, self::ALIAS_FOR_TAX_RULE_COUNTRY_POSITION) |
65
|
|
|
->orderBy(self::ALIAS_FOR_TAX_RULE_COUNTRY_POSITION, Criteria::ASC); |
66
|
|
|
; |
67
|
|
|
|
68
|
|
|
return self::$caches[$key] = $search->find(); |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
// TaxRuleQuery |
72
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths