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 | public function __construct(string $field, array $formats) |
||
23 | |||
24 | /** |
||
25 | * Set field. |
||
26 | * |
||
27 | * @return $this |
||
28 | */ |
||
29 | public function setField(string $field): self |
||
33 | |||
34 | /** |
||
35 | * Set field format. Joda pattern or one of the following formats ISO8601, UNIX, UNIX_MS, or TAI64N. |
||
36 | * |
||
37 | * @return $this |
||
38 | */ |
||
39 | public function setFormats(array $formats): self |
||
43 | |||
44 | /** |
||
45 | * Set target_field. Default value @timestamp. |
||
46 | * |
||
47 | * @return $this |
||
48 | */ |
||
49 | public function setTargetField(string $targetField): self |
||
53 | |||
54 | /** |
||
55 | * Set the timezone use when parsing the date. Default UTC. |
||
56 | * |
||
57 | * @return $this |
||
58 | */ |
||
59 | public function setTimezone(string $timezone): self |
||
63 | |||
64 | /** |
||
65 | * Set the locale to use when parsing the date. |
||
66 | * |
||
67 | * @return $this |
||
68 | */ |
||
69 | public function setLocale(string $locale): self |
||
73 | } |
||
74 |