1 | <?php |
||
12 | class DateProcessor extends AbstractProcessor |
||
13 | { |
||
14 | public const DEFAULT_TARGET_FIELD_VALUE = '@timestamp'; |
||
15 | public const DEFAULT_TIMEZONE_VALUE = 'UTC'; |
||
16 | public const DEFAULT_LOCALE_VALUE = 'ENGLISH'; |
||
17 | |||
18 | /** |
||
19 | * Date constructor. |
||
20 | */ |
||
21 | public function __construct(string $field, array $formats) |
||
26 | |||
27 | /** |
||
28 | * Set field. |
||
29 | * |
||
30 | * @return $this |
||
31 | */ |
||
32 | public function setField(string $field): self |
||
36 | |||
37 | /** |
||
38 | * Set field format. Joda pattern or one of the following formats ISO8601, UNIX, UNIX_MS, or TAI64N. |
||
39 | * |
||
40 | * @return $this |
||
41 | */ |
||
42 | public function setFormats(array $formats): self |
||
46 | |||
47 | /** |
||
48 | * Set target_field. Default value @timestamp. |
||
49 | * |
||
50 | * @return $this |
||
51 | */ |
||
52 | public function setTargetField(string $targetField): self |
||
56 | |||
57 | /** |
||
58 | * Set the timezone use when parsing the date. Default UTC. |
||
59 | * |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function setTimezone(string $timezone): self |
||
66 | |||
67 | /** |
||
68 | * Set the locale to use when parsing the date. |
||
69 | * |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function setLocale(string $locale): self |
||
76 | } |
||
77 |