PHP Класс Horde_Timezone_Rule, horde

Copyright 2011-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Jan Schneider ([email protected])
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_name string A ruleset name.
$_rules array All Rule lines for this ruleset.
$_weekdays array List to map weekday descriptions used in the timezone database.

Открытые методы

Метод Описание
__construct ( string $name ) Constructor.
add ( array $rule ) Adds a Rule line to this ruleset.
addRules ( Horde_Icalendar_Vtimezone $tz, string $tzid, string $name, array $startOffset, Horde_Date $start, Horde_Date $end = null ) Adds rules from this ruleset to a VTIMEZONE component.

Защищенные методы

Метод Описание
_findPreviousOffset ( Horde_Date $date, integer $ruleNo, integer $startOffset ) : integer Finds the offset of a previous rule.
_getDiff ( integer $ruleNo, Horde_Date $date, integer $year ) : integer Helper method to calculate the difference in days between a date and the occurence of rule.
_getFirstMatch ( array $rule, integer $year ) : Horde_Date Finds a date matching a rule definition.
_getOffset ( array $start, string $new ) : array Calculates the new offset of a timezone.
_setTime ( $date, $hour, $minute, $modifier, $utc = false )

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( string $name )
$name string A ruleset name.

_findPreviousOffset() защищенный Метод

There may be different potential rules that are "before" the current one, and there may even be two sequential daylight rules with different offsets. Thus we go through all earlier rules (as in "before the current rule in the rule definition", because the rules are ordered by start date), and find the one that starts the closest to the start date of the current rule.
protected _findPreviousOffset ( Horde_Date $date, integer $ruleNo, integer $startOffset ) : integer
$date Horde_Date The start date of the current rule.
$ruleNo integer The rule number of the current rule.
$startOffset integer The offset to use for the first rule, and also the default.
Результат integer The offset of the last rule before the current.

_getDiff() защищенный Метод

Helper method to calculate the difference in days between a date and the occurence of rule.
protected _getDiff ( integer $ruleNo, Horde_Date $date, integer $year ) : integer
$ruleNo integer A rule number.
$date Horde_Date A date.
$year integer A year.
Результат integer The days between the date and the rule occurrence in the year.

_getFirstMatch() защищенный Метод

Finds a date matching a rule definition.
protected _getFirstMatch ( array $rule, integer $year ) : Horde_Date
$rule array A rule definition hash from addRules().
$year integer A year when the rule should be applied.
Результат Horde_Date The first matching date.

_getOffset() защищенный Метод

Calculates the new offset of a timezone.
protected _getOffset ( array $start, string $new ) : array
$start array A hash describing the original timezone offset.
$new string A string describing the offset to be added to (or subtracted from) the original offset.
Результат array A hash describing the new timezone offset.

_setTime() защищенный Метод

protected _setTime ( $date, $hour, $minute, $modifier, $utc = false )

add() публичный Метод

Adds a Rule line to this ruleset.
public add ( array $rule )
$rule array A parsed Rule line.

addRules() публичный Метод

Adds rules from this ruleset to a VTIMEZONE component.
public addRules ( Horde_Icalendar_Vtimezone $tz, string $tzid, string $name, array $startOffset, Horde_Date $start, Horde_Date $end = null )
$tz Horde_Icalendar_Vtimezone A VTIMEZONE component.
$tzid string The timezone ID of the component.
$name string A timezone name abbreviation. May contain a placeholder that is replaced the Rules' "Letter(s)" entry.
$startOffset array An offset hash describing the base offset of a timezone.
$start Horde_Date Start of the period to add rules for.
$end Horde_Date End of the period to add rules for.

Описание свойств

$_name защищенное свойство

A ruleset name.
protected string $_name
Результат string

$_rules защищенное свойство

All Rule lines for this ruleset.
protected array $_rules
Результат array

$_weekdays защищенное свойство

List to map weekday descriptions used in the timezone database.
protected array $_weekdays
Результат array