PHP 클래스 Recurr\Rule

http://www.ietf.org/rfc/rfc2445.txt Information, not contained in the built/parsed RRULE, necessary to determine the various recurrence instance start time and dates are derived from the DTSTART property (default: \DateTime()). For example, "FREQ=YEARLY;BYMONTH=1" doesn't specify a specific day within the month or a time. This information would be the same as what is specified for DTSTART. BYxxx rule parts modify the recurrence in some manner. BYxxx rule parts for a period of time which is the same or greater than the frequency generally reduce or limit the number of occurrences of the recurrence generated. For example, "FREQ=DAILY;BYMONTH=1" reduces the number of recurrence instances from all days (if BYMONTH tag is not present) to all days in January. BYxxx rule parts for a period of time less than the frequency generally increase or expand the number of occurrences of the recurrence. For example, "FREQ=YEARLY;BYMONTH=1,2" increases the number of days within the yearly recurrence set from 1 (if BYMONTH tag is not present) to 2. If multiple BYxxx rule parts are specified, then after evaluating the specified FREQ and INTERVAL rule parts, the BYxxx rule parts are applied to the current set of evaluated occurrences in the following order: BYMONTH, BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYDAY, BYHOUR, BYMINUTE, BYSECOND and BYSETPOS; then COUNT and UNTIL are evaluated. Here is an example of evaluating multiple BYxxx rule parts. FREQ=YEARLY;INTERVAL=2;BYMONTH=1;BYDAY=SU;BYHOUR=8,9;BYMINUTE=30 First, the "INTERVAL=2" would be applied to "FREQ=YEARLY" to arrive at "every other year". Then, "BYMONTH=1" would be applied to arrive at "every January, every other year". Then, "BYDAY=SU" would be applied to arrive at "every Sunday in January, every other year". Then, "BYHOUR=8,9" would be applied to arrive at "every Sunday in January at 8 AM and 9 AM, every other year". Then, "BYMINUTE=30" would be applied to arrive at "every Sunday in January at 8:30 AM and 9:30 AM, every other year". Then, lacking information from RRULE, the second is derived from DTSTART, to end up in "every Sunday in January at 8:30:00 AM and 9:30:00 AM, every other year". Similarly, if the BYMINUTE, BYHOUR, BYDAY, BYMONTHDAY or BYMONTH rule part were missing, the appropriate minute, hour, day or month would have been retrieved from the "DTSTART" property. Example: The following is a rule which specifies 10 meetings which occur every other day: FREQ=DAILY;COUNT=10;INTERVAL=2
저자: Shaun Simmons ([email protected])
파일 보기 프로젝트 열기: simshaun/recurr 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$freqs

보호된 프로퍼티들

프로퍼티 타입 설명
$byDay array
$byHour array
$byMinute array
$byMonth array
$byMonthDay array
$bySecond array
$bySetPosition integer
$byWeekNumber array
$byYearDay array
$count integer | null
$days array
$endDate DateTime | null
$exDates array
$freq string
$interval integer
$isExplicitInterval boolean
$isStartDateFromDtstart boolean
$rDates array
$startDate DateTime | null
$timezone string
$until DateTime | null
$weekStart string
$weekStartDefined

공개 메소드들

메소드 설명
__construct ( string $rrule = null, string | DateTime $startDate = null, DateTime | null $endDate = null, string $timezone = null ) Construct a new Rule.
createFromArray ( array $rrule, string | DateTime $startDate = null, DateTime | null $endDate = null, string $timezone = null ) : Rule Create a Rule object based on a RRULE array.
createFromString ( string $rrule, string | DateTime $startDate = null, DateTime | null $endDate = null, string $timezone = null ) : Rule Create a Rule object based on a RRULE string.
getByDay ( ) : array Get an array of days of the week (SU, MO, TU, .
getByDayTransformedToWeekdays ( ) : array Get an array of Weekdays
getByHour ( ) : array Get an array of hours of the day.
getByMinute ( ) : array Get an array of minutes within an hour.
getByMonth ( ) : array Get an array of months of the year.
getByMonthDay ( ) : array Get an array of days of the month.
getBySecond ( ) : array Get an array of seconds within a minute.
getBySetPosition ( ) : array Get the array of values which corresponds to the nth occurrence within the set of events specified by the rule.
getByWeekNumber ( ) : array Get an array of ordinals specifying weeks of the year.
getByYearDay ( ) : array Get an array of days of the year.
getCount ( ) : integer | null Get the number of occurrences at which the recurrence is range-bound.
getEndDate ( ) : DateTime
getExDates ( ) : recurr\DateExclusion[] Get the array of dates that will not be included in a recurrence set.
getFreq ( ) : integer Get the type of recurrence rule (as integer).
getFreqAsText ( ) : string Get the type of recurrence rule (as text).
getInterval ( ) : integer Get the interval that represents how often the recurrence rule repeats.
getRDates ( ) : recurr\DateInclusion[] Get the array of dates that will be included in a recurrence set.
getStartDate ( ) : DateTime
getString ( $timezoneType = self::TZ_FLOAT ) : string Get the RRULE as a string
getTimezone ( ) : null | string Get timezone to use for \DateTime() objects that are UTC.
getUntil ( ) : DateTime | null Get the \DateTime that the recurrence lasts until.
getWeekStart ( ) : string Get the day on which the workweek starts.
getWeekStartAsNum ( ) : integer Get the day on which the workweek starts, as an integer from 0-6, 0 being Monday and 6 being Sunday.
hasByMonth ( )
loadFromArray ( $parts ) : Rule Populate the object based on a RRULE array.
loadFromString ( string $rrule ) : Rule Populate the object based on a RRULE string.
setByDay ( array $byDay ) This rule specifies an array of days of the week;
setByHour ( array $byHour ) This rule specifies an array of hours of the day.
setByMinute ( array $byMinute ) This rule specifies an array of minutes within an hour.
setByMonth ( array $byMonth ) This rule specifies an array of months of the year.
setByMonthDay ( array $byMonthDay ) This rule specifies an array of days of the month.
setBySecond ( array $bySecond ) This rule specifies an array of seconds within a minute.
setBySetPosition ( array $bySetPosition ) This rule specifies an array of values which corresponds to the nth occurrence within the set of events specified by the rule. Valid values are 1 to 366 or -366 to -1. It MUST only be used in conjunction with another BYxxx rule part.
setByWeekNumber ( array $byWeekNumber ) This rule specifies an array of ordinals specifying weeks of the year.
setByYearDay ( array $byYearDay ) This rule specifies an array of days of the year.
setCount ( integer $count ) The count defines the number of occurrences at which to range-bound the recurrence. The DTSTART counts as the first occurrence.
setEndDate ( DateTime | null $endDate ) This date specifies the last possible instance in the recurrence set.
setExDates ( array $exDates ) This rule specifies an array of exception dates that will not be included in a recurrence set.
setFreq ( string $freq ) Identifies the type of recurrence rule.
setInterval ( integer $interval ) The interval represents how often the recurrence rule repeats.
setRDates ( array $rDates ) This rule specifies an array of dates that will be included in a recurrence set.
setStartDate ( DateTime | null $startDate, boolean | null $includeInString = null ) This date specifies the first instance in the recurrence set.
setTimezone ( string $timezone )
setUntil ( DateTime $until ) Define a \DateTime value which bounds the recurrence rule in an inclusive manner. If the value specified is synchronized with the specified recurrence, this DateTime becomes the last instance of the recurrence. If not present, and a COUNT is also not present, the RRULE is considered to repeat forever.
setWeekStart ( string $weekStart ) This rule specifies the day on which the workweek starts.

비공개 메소드들

메소드 설명
convertZtoUtc ( DateTime $date ) : DateTime DateTime::setTimezone fails if the timezone does not have an ID.

메소드 상세

__construct() 공개 메소드

Construct a new Rule.
public __construct ( string $rrule = null, string | DateTime $startDate = null, DateTime | null $endDate = null, string $timezone = null )
$rrule string RRULE string
$startDate string | DateTime
$endDate DateTime | null
$timezone string

createFromArray() 공개 정적인 메소드

Create a Rule object based on a RRULE array.
public static createFromArray ( array $rrule, string | DateTime $startDate = null, DateTime | null $endDate = null, string $timezone = null ) : Rule
$rrule array RRULE array
$startDate string | DateTime
$endDate DateTime | null
$timezone string
리턴 Rule

createFromString() 공개 정적인 메소드

Create a Rule object based on a RRULE string.
public static createFromString ( string $rrule, string | DateTime $startDate = null, DateTime | null $endDate = null, string $timezone = null ) : Rule
$rrule string RRULE string
$startDate string | DateTime
$endDate DateTime | null
$timezone string
리턴 Rule

getByDay() 공개 메소드

.)
public getByDay ( ) : array
리턴 array

getByDayTransformedToWeekdays() 공개 메소드

Get an array of Weekdays
public getByDayTransformedToWeekdays ( ) : array
리턴 array of Weekdays

getByHour() 공개 메소드

Get an array of hours of the day.
public getByHour ( ) : array
리턴 array

getByMinute() 공개 메소드

Get an array of minutes within an hour.
public getByMinute ( ) : array
리턴 array

getByMonth() 공개 메소드

Get an array of months of the year.
public getByMonth ( ) : array
리턴 array

getByMonthDay() 공개 메소드

Get an array of days of the month.
public getByMonthDay ( ) : array
리턴 array

getBySecond() 공개 메소드

Get an array of seconds within a minute.
public getBySecond ( ) : array
리턴 array

getBySetPosition() 공개 메소드

Get the array of values which corresponds to the nth occurrence within the set of events specified by the rule.
public getBySetPosition ( ) : array
리턴 array

getByWeekNumber() 공개 메소드

Get an array of ordinals specifying weeks of the year.
public getByWeekNumber ( ) : array
리턴 array

getByYearDay() 공개 메소드

Get an array of days of the year.
public getByYearDay ( ) : array
리턴 array

getCount() 공개 메소드

Get the number of occurrences at which the recurrence is range-bound.
public getCount ( ) : integer | null
리턴 integer | null

getEndDate() 공개 메소드

public getEndDate ( ) : DateTime
리턴 DateTime

getExDates() 공개 메소드

Get the array of dates that will not be included in a recurrence set.
public getExDates ( ) : recurr\DateExclusion[]
리턴 recurr\DateExclusion[]

getFreq() 공개 메소드

Get the type of recurrence rule (as integer).
public getFreq ( ) : integer
리턴 integer

getFreqAsText() 공개 메소드

Get the type of recurrence rule (as text).
public getFreqAsText ( ) : string
리턴 string

getInterval() 공개 메소드

Get the interval that represents how often the recurrence rule repeats.
public getInterval ( ) : integer
리턴 integer

getRDates() 공개 메소드

Get the array of dates that will be included in a recurrence set.
public getRDates ( ) : recurr\DateInclusion[]
리턴 recurr\DateInclusion[]

getStartDate() 공개 메소드

public getStartDate ( ) : DateTime
리턴 DateTime

getString() 공개 메소드

Get the RRULE as a string
public getString ( $timezoneType = self::TZ_FLOAT ) : string
리턴 string

getTimezone() 공개 메소드

Get timezone to use for \DateTime() objects that are UTC.
public getTimezone ( ) : null | string
리턴 null | string

getUntil() 공개 메소드

Get the \DateTime that the recurrence lasts until.
public getUntil ( ) : DateTime | null
리턴 DateTime | null

getWeekStart() 공개 메소드

Get the day on which the workweek starts.
public getWeekStart ( ) : string
리턴 string

getWeekStartAsNum() 공개 메소드

Get the day on which the workweek starts, as an integer from 0-6, 0 being Monday and 6 being Sunday.
public getWeekStartAsNum ( ) : integer
리턴 integer

hasByMonth() 공개 메소드

public hasByMonth ( )

loadFromArray() 공개 메소드

Populate the object based on a RRULE array.
public loadFromArray ( $parts ) : Rule
리턴 Rule

loadFromString() 공개 메소드

Populate the object based on a RRULE string.
public loadFromString ( string $rrule ) : Rule
$rrule string RRULE string
리턴 Rule

setByDay() 공개 메소드

MO indicates Monday; TU indicates Tuesday; WE indicates Wednesday; TH indicates Thursday; FR indicates Friday; SA indicates Saturday; SU indicates Sunday. Each BYDAY value can also be preceded by a positive (+n) or negative (-n) integer. If present, this indicates the nth occurrence of the specific day within the MONTHLY or YEARLY RRULE. For example, within a MONTHLY rule, +1MO (or simply 1MO) represents the first Monday within the month, whereas -1MO represents the last Monday of the month. If an integer modifier is not present, it means all days of this type within the specified frequency. For example, within a MONTHLY rule, MO represents all Mondays within the month. ------------------------------------------- DO NOT MIX DAYS AND DAYS WITH MODIFIERS. This is not supported. -------------------------------------------
public setByDay ( array $byDay )
$byDay array Array of days of the week

setByHour() 공개 메소드

Valid values are 0 to 23.
public setByHour ( array $byHour )
$byHour array Array of hours of the day

setByMinute() 공개 메소드

Valid values are 0 to 59.
public setByMinute ( array $byMinute )
$byMinute array Array of minutes within an hour

setByMonth() 공개 메소드

Valid values are 1 to 12.
public setByMonth ( array $byMonth )
$byMonth array Array of months of the year from 1 to 12

setByMonthDay() 공개 메소드

Valid values are 1 to 31 or -31 to -1. For example, -10 represents the tenth to the last day of the month.
public setByMonthDay ( array $byMonthDay )
$byMonthDay array Array of days of the month from -31 to 31

setBySecond() 공개 메소드

Valid values are 0 to 59.
public setBySecond ( array $bySecond )
$bySecond array Array of seconds within a minute

setBySetPosition() 공개 메소드

For example "the last work day of the month" could be represented as: RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1 Each BYSETPOS value can include a positive or negative integer. If present, this indicates the nth occurrence of the specific occurrence within the set of events specified by the rule.
public setBySetPosition ( array $bySetPosition )
$bySetPosition array Array of values which corresponds to the nth occurrence within the set of events specified by the rule.

setByWeekNumber() 공개 메소드

Valid values are 1 to 53 or -53 to -1. This corresponds to weeks according to week numbering as defined in [ISO 8601]. A week is defined as a seven day period, starting on the day of the week defined to be the week start (see setWeekStart). Week number one of the calendar year is the first week which contains at least four days in that calendar year. This rule is only valid for YEARLY rules. For example, 3 represents the third week of the year. Note: Assuming a Monday week start, week 53 can only occur when Thursday is January 1 or if it is a leap year and Wednesday is January 1.
public setByWeekNumber ( array $byWeekNumber )
$byWeekNumber array Array of ordinals specifying weeks of the year.

setByYearDay() 공개 메소드

Valid values are 1 to 366 or -366 to -1. For example, -1 represents the last day of the year (December 31st) and -306 represents the 306th to the last day of the year (March 1st).
public setByYearDay ( array $byYearDay )
$byYearDay array Array of days of the year from -1 to 306

setCount() 공개 메소드

Either COUNT or UNTIL may be specified, but COUNT and UNTIL MUST NOT both be specified.
public setCount ( integer $count )
$count integer Number of occurrences

setEndDate() 공개 메소드

This date specifies the last possible instance in the recurrence set.
public setEndDate ( DateTime | null $endDate )
$endDate DateTime | null Date of the last possible instance in the recurrence

setExDates() 공개 메소드

This rule specifies an array of exception dates that will not be included in a recurrence set.
public setExDates ( array $exDates )
$exDates array Array of dates that will not be included in the recurrence set.

setFreq() 공개 메소드

May be one of: - Frequency::SECONDLY to specify repeating events based on an interval of a second or more. - Frequency::MINUTELY to specify repeating events based on an interval of a minute or more. - Frequency::HOURLY to specify repeating events based on an interval of an hour or more. - Frequency::DAILY to specify repeating events based on an interval of a day or more. - Frequency::WEEKLY to specify repeating events based on an interval of a week or more. - Frequency::MONTHLY to specify repeating events based on an interval of a month or more. - Frequency::YEAR to specify repeating events based on an interval of a year or more.
public setFreq ( string $freq )
$freq string Frequency of recurrence.

setInterval() 공개 메소드

The default value is "1", meaning every second for a SECONDLY rule, or every minute for a MINUTELY rule, every hour for an HOURLY rule, every day for a DAILY rule, every week for a WEEKLY rule, every month for a MONTHLY rule and every year for a YEARLY rule.
public setInterval ( integer $interval )
$interval integer Positive integer that represents how often the recurrence rule repeats.

setRDates() 공개 메소드

This rule specifies an array of dates that will be included in a recurrence set.
public setRDates ( array $rDates )
$rDates array Array of dates that will be included in the recurrence set.

setStartDate() 공개 메소드

This date specifies the first instance in the recurrence set.
public setStartDate ( DateTime | null $startDate, boolean | null $includeInString = null )
$startDate DateTime | null Date of the first instance in the recurrence
$includeInString boolean | null If true, include as DTSTART when calling getString()

setTimezone() 공개 메소드

또한 보기: http://www.php.net/manual/en/timezones.php
public setTimezone ( string $timezone )
$timezone string

setUntil() 공개 메소드

Either UNTIL or COUNT may be specified, but UNTIL and COUNT MUST NOT both be specified.
public setUntil ( DateTime $until )
$until DateTime The upper bound of the recurrence.

setWeekStart() 공개 메소드

Valid values are MO, TU, WE, TH, FR, SA and SU. This is significant when a WEEKLY RRULE has an interval greater than 1, and a BYDAY rule part is specified. This is also significant when in a YEARLY RRULE when a BYWEEKNO rule is specified. The default value is MO.
public setWeekStart ( string $weekStart )
$weekStart string The day on which the workweek starts.

프로퍼티 상세

$byDay 보호되어 있는 프로퍼티

protected array $byDay
리턴 array

$byHour 보호되어 있는 프로퍼티

protected array $byHour
리턴 array

$byMinute 보호되어 있는 프로퍼티

protected array $byMinute
리턴 array

$byMonth 보호되어 있는 프로퍼티

protected array $byMonth
리턴 array

$byMonthDay 보호되어 있는 프로퍼티

protected array $byMonthDay
리턴 array

$bySecond 보호되어 있는 프로퍼티

protected array $bySecond
리턴 array

$bySetPosition 보호되어 있는 프로퍼티

protected int $bySetPosition
리턴 integer

$byWeekNumber 보호되어 있는 프로퍼티

protected array $byWeekNumber
리턴 array

$byYearDay 보호되어 있는 프로퍼티

protected array $byYearDay
리턴 array

$count 보호되어 있는 프로퍼티

protected int|null $count
리턴 integer | null

$days 보호되어 있는 프로퍼티

protected array $days
리턴 array

$endDate 보호되어 있는 프로퍼티

protected DateTime|null $endDate
리턴 DateTime | null

$exDates 보호되어 있는 프로퍼티

protected array $exDates
리턴 array

$freq 보호되어 있는 프로퍼티

protected string $freq
리턴 string

$freqs 공개적으로 정적으로 프로퍼티

public static $freqs

$interval 보호되어 있는 프로퍼티

protected int $interval
리턴 integer

$isExplicitInterval 보호되어 있는 프로퍼티

protected bool $isExplicitInterval
리턴 boolean

$isStartDateFromDtstart 보호되어 있는 프로퍼티

protected bool $isStartDateFromDtstart
리턴 boolean

$rDates 보호되어 있는 프로퍼티

protected array $rDates
리턴 array

$startDate 보호되어 있는 프로퍼티

protected DateTime|null $startDate
리턴 DateTime | null

$timezone 보호되어 있는 프로퍼티

protected string $timezone
리턴 string

$until 보호되어 있는 프로퍼티

protected DateTime|null $until
리턴 DateTime | null

$weekStart 보호되어 있는 프로퍼티

protected string $weekStart
리턴 string

$weekStartDefined 보호되어 있는 프로퍼티

protected $weekStartDefined