![]() |
Xataface Calendar Module 0.1
Full Calendar for Xataface
|
A class that encapsulates the "repeating" aspects of an event. It wraps the source record and the repeat info record and provides utility methods to load, save, and delete repeat instances of the event. More...
Public Member Functions | |
getStartAtt () | |
Gets the name of the field that stores the start time in the events table. | |
getEndAtt () | |
Gets the name of the field that stores the end time in the events table. | |
getRepeatAtt () | |
Gets the name of the field that stores the repeat id for the events table. | |
getRepeatSeedAtt () | |
getSourceStart () | |
Gets the start time of the source event record. | |
getSourceEnd () | |
Gets the end time of the source event record. | |
getRepeatID () | |
Gets the repeat ID of the source event record (and all events of this repeat sequence. | |
__construct (Dataface_Record $source) | |
Creates a new RepeatEvent object to wrap the given source record. | |
loadRepeatInfo () | |
Loads the repeat info from the database into this record. | |
getDefaultExpiryDifferential () | |
saveRepeatInfo () | |
Saves the repeat info from this object into the database. Note that this does not save all repeat event records. It only stores the repeat meta-info (e.g. the frequency and expire data). | |
getRepeatRecords ($limit=250, $query=array()) | |
Gets all of the repeat event records thare are part of this repeat sequence and are after the source record. | |
updateRepeats (array $changes, $startDiffSeconds, $endDiffSeconds, $secure=false) | |
Updates all of the repeat records in this sequence with the values specified. | |
clearRepeats ($secure=false, $query=array()) | |
Deletes all repeats in the current sequence that come after the source record. | |
fillRepeats ($secure=false) | |
Creates all of the repeats for the sequence based on the source record and repeat settings. | |
isSaved () | |
Checks to see if the repeat info has already been saved. | |
setSourceRecord (Dataface_Record $record) | |
Sets the source event record for this sequence. This resets all of the repeat information (i.e. will need to recalculate) because a different record will result in likely a different repeat sequence. | |
getSourceRecord () | |
Gets the source record of this sequence. The source record is treated as the "first" event of a sequence of repeating events. All other events in this sequence will be derived from the source record. | |
setFrequency ($freq) | |
Sets the frequency of this repeat sequence. | |
getFrequency () | |
Gets the frequency of this repeat sequence. | |
setStartDate ($date) | |
Sets the start date of this sequence. | |
getStartDate () | |
setExpiryDate ($d) | |
Sets the expiry date of this sequence. | |
getExpiryDate () | |
Gets the expiry date of this sequence. | |
commit (array $changes, $startDiffSeconds, $endDiffSeconds, $secure=false) | |
Static Public Member Functions | |
static | createRepeatTable () |
Creates the table used to store repeat details. | |
static | dropRepeatTable () |
static | getModule () |
Returns a reference to the calendar module class. | |
Static Public Attributes | |
static | $EX_INVALID_FREQUENCY = 501 |
Exception code when an invalid frequency is set. | |
static | $EX_INVALID_REPEAT_ID = 502 |
Exception code when an invalid repeat id is set. |
A class that encapsulates the "repeating" aspects of an event. It wraps the source record and the repeat info record and provides utility methods to load, save, and delete repeat instances of the event.
Definition at line 7 of file RepeatEvent.class.php.
__construct | ( | Dataface_Record $ | source | ) |
Creates a new RepeatEvent object to wrap the given source record.
Dataface_Record | $source | The source or original event record that serves as a seed for this repeat sequence. |
Definition at line 272 of file RepeatEvent.class.php.
clearRepeats | ( | $ | secure = false , |
$ | query = array() |
||
) |
Deletes all repeats in the current sequence that come after the source record.
boolean | $secure | If true it will cause this to respect the permissions on each repeat record. (i.e. If a repeat record does not grant the 'delete' permission, then the delete of that repeat will fail. |
Definition at line 513 of file RepeatEvent.class.php.
commit | ( | array $ | changes, |
$ | startDiffSeconds, | ||
$ | endDiffSeconds, | ||
$ | secure = false |
||
) |
Definition at line 784 of file RepeatEvent.class.php.
static createRepeatTable | ( | ) | [static] |
Creates the table used to store repeat details.
Definition at line 100 of file RepeatEvent.class.php.
static dropRepeatTable | ( | ) | [static] |
Definition at line 120 of file RepeatEvent.class.php.
fillRepeats | ( | $ | secure = false | ) |
Creates all of the repeats for the sequence based on the source record and repeat settings.
boolean | $secure | If true this method will respect event permissions. I.e. if the 'new' permission is not granted on the events table, then the inserts will fail. |
Definition at line 556 of file RepeatEvent.class.php.
getDefaultExpiryDifferential | ( | ) |
Definition at line 308 of file RepeatEvent.class.php.
getEndAtt | ( | ) |
Gets the name of the field that stores the end time in the events table.
Exception | If no end field can be found in the events table. |
The events table is the table where the $sourceRecord record comes from.
Definition at line 220 of file RepeatEvent.class.php.
getExpiryDate | ( | ) |
Gets the expiry date of this sequence.
Definition at line 781 of file RepeatEvent.class.php.
getFrequency | ( | ) |
Gets the frequency of this repeat sequence.
Definition at line 760 of file RepeatEvent.class.php.
static getModule | ( | ) | [static] |
Returns a reference to the calendar module class.
Definition at line 167 of file RepeatEvent.class.php.
getRepeatAtt | ( | ) |
Gets the name of the field that stores the repeat id for the events table.
Exception | If no repeat field can be found in the events table. |
The events table is the table where the $sourceRecord record comes from.
Definition at line 231 of file RepeatEvent.class.php.
getRepeatID | ( | ) |
Gets the repeat ID of the source event record (and all events of this repeat sequence.
Exception | If no repeat field can be found in the events table. |
Definition at line 263 of file RepeatEvent.class.php.
getRepeatRecords | ( | $ | limit = 250 , |
$ | query = array() |
||
) |
Gets all of the repeat event records thare are part of this repeat sequence and are after the source record.
int | $limit | The maximum number of records to return. |
Definition at line 415 of file RepeatEvent.class.php.
getRepeatSeedAtt | ( | ) |
Definition at line 235 of file RepeatEvent.class.php.
getSourceEnd | ( | ) |
Gets the end time of the source event record.
Exception | If no end field can be found in the events table. |
Definition at line 253 of file RepeatEvent.class.php.
getSourceRecord | ( | ) |
Gets the source record of this sequence. The source record is treated as the "first" event of a sequence of repeating events. All other events in this sequence will be derived from the source record.
Definition at line 728 of file RepeatEvent.class.php.
getSourceStart | ( | ) |
Gets the start time of the source event record.
Exception | If no start field can be found in the events table. |
Definition at line 244 of file RepeatEvent.class.php.
getStartAtt | ( | ) |
Gets the name of the field that stores the start time in the events table.
Exception | If no start field can be found in the events table. |
The events table is the table where the $sourceRecord record comes from.
Definition at line 208 of file RepeatEvent.class.php.
getStartDate | ( | ) |
Definition at line 769 of file RepeatEvent.class.php.
isSaved | ( | ) |
Checks to see if the repeat info has already been saved.
Definition at line 695 of file RepeatEvent.class.php.
loadRepeatInfo | ( | ) |
Loads the repeat info from the database into this record.
Note that this does not save all of the repeat event records. It only stores the repeat meta-info (e.g. the frequency and expire date).
Definition at line 285 of file RepeatEvent.class.php.
saveRepeatInfo | ( | ) |
Saves the repeat info from this object into the database. Note that this does not save all repeat event records. It only stores the repeat meta-info (e.g. the frequency and expire data).
Exception | If the frequency is not set or is invalid. (CODE=self::$EX_INVALID_FREQUENCY) |
Exception | If there is no valid repeat id and there is no repeat_seed field from which a repeat id can be derived. (CODE=self::$EX_INVALID_REPEAT_ID) |
Definition at line 331 of file RepeatEvent.class.php.
setExpiryDate | ( | $ | d | ) |
Sets the expiry date of this sequence.
string | $date | A datetime string to serve as the expiry date of this sequence. |
Definition at line 775 of file RepeatEvent.class.php.
setFrequency | ( | $ | freq | ) |
Sets the frequency of this repeat sequence.
string | $freq | The frequency of this repeat sequence. Possible values include:
|
Definition at line 742 of file RepeatEvent.class.php.
setSourceRecord | ( | Dataface_Record $ | record | ) |
Sets the source event record for this sequence. This resets all of the repeat information (i.e. will need to recalculate) because a different record will result in likely a different repeat sequence.
Definition at line 713 of file RepeatEvent.class.php.
setStartDate | ( | $ | date | ) |
Sets the start date of this sequence.
string | $date | A datetime string to serve as the start date of this sequence (not to be confused with the start time of the event). |
Definition at line 767 of file RepeatEvent.class.php.
updateRepeats | ( | array $ | changes, |
$ | startDiffSeconds, | ||
$ | endDiffSeconds, | ||
$ | secure = false |
||
) |
Updates all of the repeat records in this sequence with the values specified.
Note that this will only affect repeat records that are later than the source record.
array | $changes | Associative array of values that are to be updated in the records. |
int | $startDiffSeconds | How many seconds the start times should be shifted by each. |
int | $endDiffSeconds | How many seconds the end times should be shifted by each. |
boolean | $secure | If true then this will respect permissions when trying to save the repeat records. (i.e. they will each need to grant the 'edit' permission in order to save successfully). |
Definition at line 444 of file RepeatEvent.class.php.
$EX_INVALID_FREQUENCY = 501 [static] |
Exception code when an invalid frequency is set.
Definition at line 12 of file RepeatEvent.class.php.
$EX_INVALID_REPEAT_ID = 502 [static] |
Exception code when an invalid repeat id is set.
Definition at line 17 of file RepeatEvent.class.php.