| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function buildQuery(array $data): ?AbstractQuery |
||
| 30 | { |
||
| 31 | $attributeQuery = new BoolQuery(); |
||
| 32 | |||
| 33 | foreach ((array) $data['attribute_values'] as $attributeValue) { |
||
| 34 | $termQuery = new Term(); |
||
| 35 | $attribute = \sprintf('%s_%s', $data['attribute'], $this->localeContext->getLocaleCode()); |
||
| 36 | $termQuery->setTerm( |
||
| 37 | strtolower($attribute), |
||
| 38 | $attributeValue |
||
| 39 | ); |
||
| 40 | |||
| 41 | $attributeQuery->addShould($termQuery); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $attributeQuery; |
||
| 45 | } |
||
| 47 |