TimespanOptionFactory
in package
Class representing a time span dropdown option.
Table of Contents
- ID = "timespan"
- Dropdown ID.
- DEFAULT_VALUE = "week"
- Default value.
- ITEM_TODAY = ['today' => [self::LANGUAGE_CODE_GERMAN => "Heute", self::LANGUAGE_CODE_ENGLISH => "Today"]]
- Today dropdown item.
- ITEMS = ["week" => [self::LANGUAGE_CODE_GERMAN => "Diese Woche", self::LANGUAGE_CODE_ENGLISH => "This week"], "month" => [self::LANGUAGE_CODE_GERMAN => "Dieser Monat", self::LANGUAGE_CODE_ENGLISH => "This month"], "year" => [self::LANGUAGE_CODE_GERMAN => "Dieses Jahr", self::LANGUAGE_CODE_ENGLISH => "This year"], "all" => [self::LANGUAGE_CODE_GERMAN => "Gesamt", self::LANGUAGE_CODE_ENGLISH => "Entire period"]]
- Dropdown items.
- LANGUAGE_CODE_ENGLISH = "en"
- English language code.
- LANGUAGE_CODE_GERMAN = "de"
- German language code.
- TITLES = [self::LANGUAGE_CODE_GERMAN => "Zeitraum", self::LANGUAGE_CODE_ENGLISH => "Time Span"]
- Multilingual titles.
- create() : DropdownOption
- Return dropdown.
- createIncludingToday() : DropdownOption
- Return dropdown including today.
- createItems() : OptionItems
- Return dropdown items.
- createTitles() : OptionTitles
- Return multilingual titles.
Constants
ID
Dropdown ID.
public
mixed
ID
= "timespan"
DEFAULT_VALUE
Default value.
private
mixed
DEFAULT_VALUE
= "week"
ITEM_TODAY
Today dropdown item.
private
mixed
ITEM_TODAY
= ['today' => [self::LANGUAGE_CODE_GERMAN => "Heute", self::LANGUAGE_CODE_ENGLISH => "Today"]]
ITEMS
Dropdown items.
private
mixed
ITEMS
= ["week" => [self::LANGUAGE_CODE_GERMAN => "Diese Woche", self::LANGUAGE_CODE_ENGLISH => "This week"], "month" => [self::LANGUAGE_CODE_GERMAN => "Dieser Monat", self::LANGUAGE_CODE_ENGLISH => "This month"], "year" => [self::LANGUAGE_CODE_GERMAN => "Dieses Jahr", self::LANGUAGE_CODE_ENGLISH => "This year"], "all" => [self::LANGUAGE_CODE_GERMAN => "Gesamt", self::LANGUAGE_CODE_ENGLISH => "Entire period"]]
LANGUAGE_CODE_ENGLISH
English language code.
private
mixed
LANGUAGE_CODE_ENGLISH
= "en"
LANGUAGE_CODE_GERMAN
German language code.
private
mixed
LANGUAGE_CODE_GERMAN
= "de"
TITLES
Multilingual titles.
private
mixed
TITLES
= [self::LANGUAGE_CODE_GERMAN => "Zeitraum", self::LANGUAGE_CODE_ENGLISH => "Time Span"]
Methods
create()
Return dropdown.
public
static create(StatisticsOverviewFactory $factory) : DropdownOption
Parameters
- $factory : StatisticsOverviewFactory
-
Factory.
Return values
DropdownOption —Instance.
createIncludingToday()
Return dropdown including today.
public
static createIncludingToday(StatisticsOverviewFactory $factory) : DropdownOption
Parameters
- $factory : StatisticsOverviewFactory
-
Factory.
Return values
DropdownOption —Instance.
createItems()
Return dropdown items.
private
static createItems(StatisticsOverviewFactory $factory, array<string|int, mixed> $items) : OptionItems
Parameters
- $factory : StatisticsOverviewFactory
-
Factory.
- $items : array<string|int, mixed>
-
Dropdown items.
Return values
OptionItems —Dropdown Items.
createTitles()
Return multilingual titles.
private
static createTitles(StatisticsOverviewFactory $factory) : OptionTitles
Parameters
- $factory : StatisticsOverviewFactory
-
Factory.
Return values
OptionTitles —Multilingual titles.