1 | <?php |
||
13 | class DateIndexNameProcessor extends AbstractProcessor |
||
14 | { |
||
15 | public const DEFAULT_DATE_FORMATS_VALUE = ['ISO8601']; |
||
16 | public const DEFAULT_INDEX_NAME_FORMAT_VALUE = 'yyyy-MM-dd'; |
||
17 | public const DEFAULT_TIMEZONE_VALUE = 'UTC'; |
||
18 | public const DEFAULT_LOCALE_VALUE = 'ENGLISH'; |
||
19 | |||
20 | /** |
||
21 | * DateIndexName constructor. |
||
22 | */ |
||
23 | public function __construct(string $field, string $dateRounding) |
||
28 | |||
29 | /** |
||
30 | * Set field. |
||
31 | * |
||
32 | * @return $this |
||
33 | */ |
||
34 | public function setField(string $field): self |
||
38 | |||
39 | /** |
||
40 | * Set date_rounding. Valid values are: y (year), M (month), w (week), d (day), h (hour), m (minute) and s (second). |
||
41 | * |
||
42 | * @return $this |
||
43 | */ |
||
44 | public function setDateRounding(string $dateRounding): self |
||
48 | |||
49 | /** |
||
50 | * Set field formats. Joda pattern or one of the following formats ISO8601, UNIX, UNIX_MS, or TAI64N. |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function setDateFormats(array $formats): self |
||
58 | |||
59 | /** |
||
60 | * Set index_prefix_name. |
||
61 | * |
||
62 | * @return $this |
||
63 | */ |
||
64 | public function setIndexNamePrefix(string $indexPrefixName): self |
||
68 | |||
69 | /** |
||
70 | * Set format to be used when printing parsed date. An valid Joda pattern is expected here. Default yyyy-MM-dd. |
||
71 | * |
||
72 | * @return $this |
||
73 | */ |
||
74 | public function setIndexNameFormat(string $indexNameFormat): self |
||
78 | |||
79 | /** |
||
80 | * Set the timezone use when parsing the date. Default UTC. |
||
81 | * |
||
82 | * @return $this |
||
83 | */ |
||
84 | public function setTimezone(string $timezone): self |
||
88 | |||
89 | /** |
||
90 | * Set the locale to use when parsing the date. |
||
91 | * |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function setLocale(string $locale): self |
||
98 | } |
||
99 |