| 1 | <?php |
||
| 13 | class ForeachProcessor extends AbstractProcessor |
||
| 14 | { |
||
| 15 | public const DEFAULT_IGNORE_MISSING_VALUE = false; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Foreach constructor. |
||
| 19 | */ |
||
| 20 | public function __construct(string $field) |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Set field. |
||
| 27 | * |
||
| 28 | * @return $this |
||
| 29 | */ |
||
| 30 | public function setField(string $field): self |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Set processor. |
||
| 37 | * |
||
| 38 | * @param AbstractProcessor |
||
| 39 | * |
||
| 40 | * @return $this |
||
| 41 | */ |
||
| 42 | public function setProcessor(AbstractProcessor $processor): self |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Set raw processor. |
||
| 49 | * Example : ['remove' => ['field' => 'user_agent']]. |
||
| 50 | * |
||
| 51 | * @return $this |
||
| 52 | */ |
||
| 53 | public function setRawProcessor(array $processor): self |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Set ignore_missing. Default value false. |
||
| 60 | * |
||
| 61 | * If true and field does not exist or is null, the processor quietly exits without modifying the document |
||
| 62 | * |
||
| 63 | * @return $this |
||
| 64 | */ |
||
| 65 | public function setIgnoreMissing(bool $ignoreMissing): self |
||
| 69 | } |
||
| 70 |