| 1 | <?php |
||
| 22 | $this->setParameters($parameters); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function getType(): string |
||
| 26 | { |
||
| 27 | return 'term'; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function toArray(): array |
||
| 31 | { |
||
| 32 | $query = $this->processArray(); |
||
| 33 | |||
| 34 | if (empty($query)) { |
||
| 35 | $query = $this->value; |
||
| 36 | } else { |
||
| 37 | $query['value'] = $this->value; |
||
| 38 | } |
||
| 39 | |||
| 40 | $output = [ |
||
| 41 | $this->field => $query, |
||
| 42 | ]; |
||
| 43 | |||
| 44 | return [$this->getType() => $output]; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |