Class CalendarEvents
-
Model
-
AppModel
-
CalendarEvents
Methods summary
public
|
#
__construct( )
Initialize the CalendarEvents
Initialize the CalendarEvents
Overrides
|
public
integer
|
#
add( array $vars )
Adds a calendar event
Parameters
- $vars
array $vars An array of calendar event data including: -company_id The ID of the
company to add this event under -staff_id The ID of the staff member that
created this event -shared Whether or not this event is shared among other staff
members of this company (true to share false otherwise, default false) -title
The title of the event -url The URL to link this event to (optional, default
null) -start_date The start date of the event -end_date The end date of the
event -all_day Whether or not this event spans the entire day of the start/end
dates (default false)
Returns
integer The ID of the calendar event created, void on error
|
public
|
#
edit( integer $calendar_event_id, array $vars )
Updates a calendar event
Parameters
- $calendar_event_id
integer $calendar_event_id The ID of the calendar event to update
- $vars
array $vars An array of calendar event data including (only parameters submitted will
be updated): -company_id The ID of the company to add this event under -staff_id
The ID of the staff member that created this event (required) -shared Whether or
not this event is shared among other staff members of this company (true to
share false otherwise) -title The title of the event -url The URL to link this
event to -start_date The start date of the event -end_date The end date of the
event -all_day Whether or not this event spans the entire day of the start/end
dates
|
public
|
#
delete( integer $calendar_event_id )
Deletes a calendar event
Parameters
- $calendar_event_id
integer $calendar_event_id The ID of the calendar event to delete
|
public
mixed
|
#
get( integer $calendar_event_id )
Fetches a calendar event
Parameters
- $calendar_event_id
integer $calendar_event_id The ID of the calendar event to fetch
Returns
mixed A stdClass object representing the calendar event, false if no such event exists
|
public
array
|
#
getAll( integer $company_id, integer $staff_id, string $start_date, string $end_date, boolean $include_shared = true )
Fetches all of events that begin between the given start and end dates
Fetches all of events that begin between the given start and end dates
Parameters
- $company_id
integer $company_id The ID of the company to fetch for
- $staff_id
integer $staff_id The ID of the staff member to fetch for
- $start_date
string $start_date Defines the lower bound for event start dates
- $end_date
string $end_date Defines the upper bound for event start dates
- $include_shared
boolean $include_shared If true will include shared calendar events, false will only
include events for this staff member
Returns
array An array of stdClass objects, each representing a calendar event
See
|
public
array
|
#
getRange( integer $company_id, integer $staff_id, string $start_date, string $end_date, boolean $include_shared = true )
Fetches a set of events that begin or end between the given start and end
dates (e.g. exist between the given start and end dates).
Fetches a set of events that begin or end between the given start and end
dates (e.g. exist between the given start and end dates).
Parameters
- $company_id
integer $company_id The ID of the company to fetch for
- $staff_id
integer $staff_id The ID of the staff member to fetch for
- $start_date
string $start_date Defines the lower bound for event start/end dates
- $end_date
string $end_date Defines the upper bound for event start/end dates
- $include_shared
boolean $include_shared If true will include shared calendar events, false will only
include events for this staff member
Returns
array An array of stdClass objects, each representing a calendar event
See
|
private
Record
|
#
getEvents( )
Returns a Record objects consisting of a partial query on calendar events
Returns a Record objects consisting of a partial query on calendar events
Returns
Record
A partial query on calendar events
|
private
array
|
#
getRules( array $vars, boolean $edit = false )
Retrieves a list of add/edit rules
Retrieves a list of add/edit rules
Parameters
- $vars
array $vars A list of input vars
- $edit
boolean $edit True to retrieve the edit rules, false to retrieve the add rules
(optional, default false)
Returns
array A list of input rules
|
public
boolean
|
#
validateStaffEvent( integer $staff_id, integer $event_id )
Validates whether the given event belongs to the given staff member
Validates whether the given event belongs to the given staff member
Parameters
- $staff_id
integer $staff_id The ID of the staff member that created this event
- $event_id
integer $event_id The ID of the calendar event created
Returns
boolean True if the calendar event belongs to the given staff member, false otherwise
|
public
|
#
validateDateOrder( string $start_date, string $end_date )
Validates that the given start date is before the given end date,
inclusive
Validates that the given start date is before the given end date,
inclusive
Parameters
- $start_date
string $start_date The start date
- $end_date
string $end_date The end date
|
Methods inherited from AppModel
_()
,
boolToInt()
,
currencyToDecimal()
,
dateToUtc()
,
errors()
,
getPerPage()
,
ifSet()
,
loadCrypto()
,
setDefaultIfEmpty()
,
setPerPage()
,
setRulesIfSet()
,
strToBool()
,
systemDecrypt()
,
systemEncrypt()
,
systemHash()
,
truncateDecimal()
,
validateExists()
,
validateStateCountry()
Methods inherited from Model
affectedRows()
,
begin()
,
commit()
,
getConnection()
,
lastInsertId()
,
makeDSN()
,
prepare()
,
query()
,
rollBack()
,
setAttribute()
,
setFetchMode()
Magic methods summary
Properties summary
Properties inherited from AppModel
$replacement_keys