| 1 | <?php |
||
| 13 | class ForeachProcessor extends AbstractProcessor |
||
| 14 | { |
||
| 15 | public const DEFAULT_IGNORE_MISSING_VALUE = false; |
||
| 16 | protected const PROCESSOR_NAME = 'foreach'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Set field. |
||
| 20 | * |
||
| 21 | * @return $this |
||
| 22 | */ |
||
| 23 | public function setField(string $field): self |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Set processor. |
||
| 30 | * |
||
| 31 | * @param AbstractProcessor |
||
| 32 | * |
||
| 33 | * @return $this |
||
| 34 | */ |
||
| 35 | public function setProcessor(AbstractProcessor $processor): self |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Set raw processor. |
||
| 42 | * Example : ['remove' => ['field' => 'user_agent']]. |
||
| 43 | * |
||
| 44 | * @return $this |
||
| 45 | */ |
||
| 46 | public function setRawProcessor(array $processor): self |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Set ignore_missing. Default value false. |
||
| 53 | * |
||
| 54 | * If true and field does not exist or is null, the processor quietly exits without modifying the document |
||
| 55 | * |
||
| 56 | * @return $this |
||
| 57 | */ |
||
| 58 | public function setIgnoreMissing(bool $ignoreMissing): self |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Param's name |
||
| 65 | * Picks the last part of the class name and makes it snake_case |
||
| 66 | * You can override this method if you want to change the name. |
||
| 67 | * |
||
| 68 | * @return string name |
||
| 69 | */ |
||
| 70 | protected function _getBaseName() |
||
| 74 | } |
||
| 75 |