Squiz Matrix
4.12.2
|
Public Member Functions | |
getSingleEventQueryBase ($root_ids, $event_type_code='calendar_event_single', $include_exceptions=TRUE, &$bind_vars=Array()) | |
getRecurringEventQueryBase ($root_ids, $view, $iso, $length=NULL, $event_type='calendar_event_recurring', &$bind_vars=Array()) | |
condenseResultTreeids ($raw) | |
& | expandEventList (&$events, $first_day, $last_day, $day_start_time='00:00', $day_end_time='23:59') |
processExceptions (&$res) | |
compareStartDates ($a, $b) | |
compareEventLengths ($a, $b) | |
getDateComponents ($iso, $prefix='') | |
_getTableList () | |
_ts2Sql ($y, $m, $d, $h='00', $i='00', $s='00') | |
_getTreeClause ($root_ids) | |
_expandSingleEvent (&$result_list, &$event, $assetid, $first_day, $last_day, $day_start_time, $day_end_time) | |
_expandRecurringEvent (&$result_list, &$event, $assetid, $first_day, $last_day, $day_start_time, $day_end_time) | |
_getDayStamp ($value) | |
_getMonthStamp ($value) | |
_getTypeDescendantsQuoted ($type_code) | |
limitRecurringEventInstances ($events, $instances) | |
getWholeEventInstances ($events, $first_day, $last_day, $day_start_time='00:00', $day_end_time='23:59') | |
_getSingleEventWholeInstance (&$result_list, &$event, $assetid, $limit_start_day, $limit_end_day, $limit_start_time, $limit_end_time) | |
_getRecurringEventWholeInstances (&$result_list, $event, $assetid, $first_day, $last_day, $day_start_time, $day_end_time, $frequency_threshold) | |
+-----------------------------------------------------------------—+ | This MySource Matrix CMS file is Copyright (c) Squiz Pty Ltd | | ABN 77 084 670 600 | +-----------------------------------------------------------------—+ | IMPORTANT: Your use of this Software is subject to the terms of | | the Licence provided in the file licence.txt. If you cannot find | | this file please contact Squiz (www.squiz.com.au) so we may provide| | you a copy. | +-----------------------------------------------------------------—+
Definition at line 33 of file calendar_common.inc.
_expandRecurringEvent | ( | & | $result_list, |
& | $event, | ||
$assetid, | |||
$first_day, | |||
$last_day, | |||
$day_start_time, | |||
$day_end_time | |||
) |
Expands a list of recurring events into a series of single-day events
array | &$result_list | The result array to append the expanded events to |
array | &$event | The cached calendar components of the event to expand (format as per structure of cal_date_val table) |
int | $assetid | The asset ID of the event being expanded |
string | $first_day | The first day we want to display (YYYY-MM-DD) |
string | $last_day | The last day we want to display (YYYY-MM-DD) |
string | $day_start_time | Earliest time of day we will display (HH:mm) |
string | $day_end_time | Latest time of day we will display (HH:mm) |
Definition at line 1016 of file calendar_common.inc.
_expandSingleEvent | ( | & | $result_list, |
& | $event, | ||
$assetid, | |||
$first_day, | |||
$last_day, | |||
$day_start_time, | |||
$day_end_time | |||
) |
Expands a multiple-day single event into a series of single-day events
array | &$result_list | The result array to append the expanded events to |
array | &$event | The cached calendar components of the event to expand (format as per structure of cal_date_val table) |
int | $assetid | The asset ID of the event being expanded |
string | $first_day | The first day we want to display (YYYY-MM-DD) |
string | $last_day | The last day we want to display (YYYY-MM-DD) |
string | $day_start_time | Earliest time of day we will display (HH:mm) |
string | $day_end_time | Latest time of day we will display (HH:mm) |
Definition at line 883 of file calendar_common.inc.
_getDayStamp | ( | $value | ) |
Get the daystamp value for the supplied date
int | string | $value | The date to convert, either a timestamp or ISO-format date |
Definition at line 1235 of file calendar_common.inc.
_getMonthStamp | ( | $value | ) |
Get the monthstamp value for the supplied date
int | string | $value | The date to convert, either a timestamp or ISO-format date |
Definition at line 1257 of file calendar_common.inc.
_getRecurringEventWholeInstances | ( | & | $result_list, |
$event, | |||
$assetid, | |||
$first_day, | |||
$last_day, | |||
$day_start_time, | |||
$day_end_time, | |||
$frequency_threshold | |||
) |
Expands a list of recurring events into a series of whole events
array | &$result_list | The result array to append the expanded events to |
array | $event | The cached calendar components of the event to expand (format as per structure of cal_date_val table) |
int | $assetid | The asset ID of the event being expanded |
string | $first_day | The first day we want to display (YYYY-MM-DD) |
string | $last_day | The last day we want to display (YYYY-MM-DD) |
string | $day_start_time | Earliest time of day we will display (HH:mm) |
string | $day_end_time | Latest time of day we will display (HH:mm) |
string | $frequency_threshold |
Definition at line 1448 of file calendar_common.inc.
_getSingleEventWholeInstance | ( | & | $result_list, |
& | $event, | ||
$assetid, | |||
$limit_start_day, | |||
$limit_end_day, | |||
$limit_start_time, | |||
$limit_end_time | |||
) |
Returns the whole single event instance
array | &$result_list | The result array to append the expanded events to |
array | $event | The cached calendar components of the event to expand (format as per structure of cal_date_val table) |
int | $assetid | The asset ID of the event being expanded |
string | $first_day | The first day we want to display (YYYY-MM-DD) |
string | $last_day | The last day we want to display (YYYY-MM-DD) |
string | $day_start_time | Earliest time of day we will display (HH:mm) |
string | $day_end_time | Latest time of day we will display (HH:mm) |
Definition at line 1391 of file calendar_common.inc.
_getTableList | ( | ) |
_getTreeClause | ( | $root_ids | ) |
Returns an SQL fragment to restrict results to have treeids in the given range
array | $root_ids | Root nodes for the listing |
Definition at line 853 of file calendar_common.inc.
_getTypeDescendantsQuoted | ( | $type_code | ) |
Returns a QUOTED array of a type's descendants
string | $type_code | Type code |
Definition at line 1278 of file calendar_common.inc.
_ts2Sql | ( | $y, | |
$m, | |||
$d, | |||
$h = '00' , |
|||
$i = '00' , |
|||
$s = '00' |
|||
) |
Build SQL to express the unix timestamp represented by the supplied date component expressions
string | $y | Expression for the year component of the date |
string | $m | Expression for the month component of the date |
string | $d | Expression for the day component of the date |
string | $h | Expression for the hour component of the time |
string | $i | Expression for the minute component of the time |
string | $s | Expression for the second component of the time |
Definition at line 821 of file calendar_common.inc.
compareEventLengths | ( | $a, | |
$b | |||
) |
compare lengths of two events
array | $a | Details of first comparee event |
array | $b | Details of second comparee event |
Definition at line 671 of file calendar_common.inc.
compareStartDates | ( | $a, | |
$b | |||
) |
Return true if event $a starts before $b
array | $a | Details of first comparee event |
array | $b | Details of second comparee event |
Definition at line 655 of file calendar_common.inc.
condenseResultTreeids | ( | $raw | ) |
Condense a result with a new row for each treeid to a result with a new row for each assetid
Makes the 'treeid' entry into an array of treeids
array | $raw | The raw result with a row for each treeid |
Definition at line 521 of file calendar_common.inc.
& expandEventList | ( | & | $events, |
$first_day, | |||
$last_day, | |||
$day_start_time = '00:00' , |
|||
$day_end_time = '23:59' |
|||
) |
Expands list of multiple day and/or recurring events into a series of single-day events
Returned list of events is indexed by a shadow-asset-like identifier of 'assetid:instance' where instance is a 0-based index of how many times an instance the event has occurred previously.
array | &$events | Array of Events |
string | $first_day | The first day we want to display (YYYY-MM-DD) |
string | $last_day | The last day we want to display (YYYY-MM-DD) |
string | $day_start_time | Earliest time of day we will display (HH:mm) |
string | $day_end_time | Latest time of day we will display (HH:mm) |
Definition at line 553 of file calendar_common.inc.
getDateComponents | ( | $iso, | |
$prefix = '' |
|||
) |
Split a datetime attribute into revelant components
string | $iso | the date to split up in ISO format |
string | $prefix | the prefix to add to array keys generated by this fn |
Definition at line 687 of file calendar_common.inc.
getRecurringEventQueryBase | ( | $root_ids, | |
$view, | |||
$iso, | |||
$length = NULL , |
|||
$event_type = 'calendar_event_recurring' , |
|||
& | $bind_vars = Array() |
||
) |
Builds the common part of the recurring events query
The ISO 8601 date is taken as passed to the calling function - this means the:
array | $root_ids | Array of root nodes |
string | $view | the type of view we are requesting (day|week|month|year|period) |
string | $iso | ISO 8601 date as passed to the calling function |
int | $length | Length of period to look in (period view only) |
string | $event_type | Desired event type |
array | $bind_vars | Vars to bind when preparing the query later |
Definition at line 105 of file calendar_common.inc.
getSingleEventQueryBase | ( | $root_ids, | |
$event_type_code = 'calendar_event_single' , |
|||
$include_exceptions = TRUE , |
|||
& | $bind_vars = Array() |
||
) |
Builds the common part of the single events query
array | $root_ids | Root node IDs |
string | $event_type_code | Type of the event |
boolean | $include_exceptions | Include exceptions |
array | $bind_vars | Vars to bind when preparing the query later |
Definition at line 48 of file calendar_common.inc.
getWholeEventInstances | ( | $events, | |
$first_day, | |||
$last_day, | |||
$day_start_time = '00:00' , |
|||
$day_end_time = '23:59' |
|||
) |
Expands list of single day and/or recurring events into a series of whole event instances
array | &$events | Array of Events |
string | $first_day | The first day we want to display (YYYY-MM-DD) |
string | $last_day | The last day we want to display (YYYY-MM-DD) |
string | $day_start_time | Earliest time of day we will display (HH:mm) |
string | $day_end_time | Latest time of day we will display (HH:mm) |
Definition at line 1351 of file calendar_common.inc.
limitRecurringEventInstances | ( | $events, | |
$instances | |||
) |
Removes the recurring events instances all but first one if event's frequency is less than the predefined event frequency threshold
array | $events | Array of Events |
string | $first_day | Events instances |
Definition at line 1305 of file calendar_common.inc.
processExceptions | ( | & | $res | ) |
Process exception events (cancellations and modifications) from the set of events passed
When a cancellation or modification event is found in the set, its parent recurring event is removed from the set, and for cancellation events they themselves are removed too
array | &$res | a ($id => array(...)) array of events |
Definition at line 581 of file calendar_common.inc.