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])
파일 보기 프로젝트 열기: horde/horde

보호된 프로퍼티들

프로퍼티 타입 설명
$_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