1 | <?php |
||
12 | class DateIndexNameProcessor extends AbstractProcessor |
||
13 | { |
||
14 | public const DEFAULT_DATE_FORMATS_VALUE = ['ISO8601']; |
||
15 | public const DEFAULT_INDEX_NAME_FORMAT_VALUE = 'yyyy-MM-dd'; |
||
16 | public const DEFAULT_TIMEZONE_VALUE = 'UTC'; |
||
17 | public const DEFAULT_LOCALE_VALUE = 'ENGLISH'; |
||
18 | |||
19 | public function __construct(string $field, string $dateRounding) |
||
24 | |||
25 | /** |
||
26 | * Set field. |
||
27 | * |
||
28 | * @return $this |
||
29 | */ |
||
30 | public function setField(string $field): self |
||
34 | |||
35 | /** |
||
36 | * Set date_rounding. Valid values are: y (year), M (month), w (week), d (day), h (hour), m (minute) and s (second). |
||
37 | * |
||
38 | * @return $this |
||
39 | */ |
||
40 | public function setDateRounding(string $dateRounding): self |
||
44 | |||
45 | /** |
||
46 | * Set field formats. Joda pattern or one of the following formats ISO8601, UNIX, UNIX_MS, or TAI64N. |
||
47 | * |
||
48 | * @return $this |
||
49 | */ |
||
50 | public function setDateFormats(array $formats): self |
||
54 | |||
55 | /** |
||
56 | * Set index_prefix_name. |
||
57 | * |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function setIndexNamePrefix(string $indexPrefixName): self |
||
64 | |||
65 | /** |
||
66 | * Set format to be used when printing parsed date. An valid Joda pattern is expected here. Default yyyy-MM-dd. |
||
67 | * |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function setIndexNameFormat(string $indexNameFormat): self |
||
74 | |||
75 | /** |
||
76 | * Set the timezone use when parsing the date. Default UTC. |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function setTimezone(string $timezone): self |
||
84 | |||
85 | /** |
||
86 | * Set the locale to use when parsing the date. |
||
87 | * |
||
88 | * @return $this |
||
89 | */ |
||
90 | public function setLocale(string $locale): self |
||
94 | } |
||
95 |