Property | Type | Description | |
---|---|---|---|
$shortName | short name (internal name) of this holiday | ||
$translations | list of translations of this holiday |
Method | Description | |
---|---|---|
__construct ( string $shortName, array $names, DateTime $date, string $displayLocale = self::DEFAULT_LOCALE, string $type = self::TYPE_NATIONAL ) | Creates a new Holiday. | |
__toString ( ) : string | Format the instance as a string using the set format. | |
getName ( ) | Returns the name of this holiday. | |
getType ( ) : string | Returns what type this holiday is. | |
jsonSerialize ( ) | Serializes the object to a value that can be serialized natively by json_encode(). | |
mergeGlobalTranslations ( yasumi\TranslationsInterface $globalTranslations ) | Merges local translations (preferred) with global translations. |
public __construct ( string $shortName, array $names, DateTime $date, string $displayLocale = self::DEFAULT_LOCALE, string $type = self::TYPE_NATIONAL ) | ||
$shortName | string | The short name (internal name) of this holiday |
$names | array | An array containing the name/description of this holiday in various languages. Overrides global translations |
$date | DateTime | A DateTime instance representing the date of the holiday |
$displayLocale | string | Locale (i.e. language) in which the holiday information needs to be displayed in. (Default 'en_US') |
$type | string | The type of holiday. Use the following constants: TYPE_NATIONAL, TYPE_OBSERVANCE, TYPE_SEASON, TYPE_BANK or TYPE_OTHER. By default a national holiday is considered. |
public __toString ( ) : string | ||
return | string |
public getName ( ) |
public jsonSerialize ( ) |
public mergeGlobalTranslations ( yasumi\TranslationsInterface $globalTranslations ) | ||
$globalTranslations | yasumi\TranslationsInterface | global translations |