PHP 클래스 Yasumi\Holiday

상속: extends DateTim\DateTime, implements JsonSerializabl\JsonSerializable
파일 보기 프로젝트 열기: azuyalabs/yasumi 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$shortName short name (internal name) of this holiday
$translations list of translations of this holiday

공개 메소드들

메소드 설명
__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.

메소드 상세

__construct() 공개 메소드

If a holiday date needs to be defined for a specific timezone, make sure that the date instance (DateTime) has the correct timezone set. Otherwise the default system timezone is used.
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.

__toString() 공개 메소드

Format the instance as a string using the set format.
public __toString ( ) : string
리턴 string

getName() 공개 메소드

The name of this holiday is returned translated in the given locale. If for the given locale no translation is defined, the name in the default locale ('en_US') is returned. In case there is no translation at all, the short internal name is returned.
public getName ( )

getType() 공개 메소드

Returns what type this holiday is.
public getType ( ) : string
리턴 string the type of holiday (national, observance, season or bank).

jsonSerialize() 공개 메소드

Serializes the object to a value that can be serialized natively by json_encode().
public jsonSerialize ( )

mergeGlobalTranslations() 공개 메소드

Merges local translations (preferred) with global translations.
public mergeGlobalTranslations ( yasumi\TranslationsInterface $globalTranslations )
$globalTranslations yasumi\TranslationsInterface global translations

프로퍼티 상세

$shortName 공개적으로 프로퍼티

short name (internal name) of this holiday
public $shortName

$translations 공개적으로 프로퍼티

list of translations of this holiday
public $translations