\C_Calendar

Class C_Calendar This class has DB operations regarding calendar create/update, loading properties & settings

Description: This class has DB operations regarding calendar create/update and loading properties. Also it has calendar settings like timezone, time format, default view, date formats, week start day, language etc. It extends C_Calendar_Settings class

Summary

Methods
Properties
Constants
__construct()
loadAllCalendars()
saveCalendar()
editCalendar()
loadCalendarSettings()
saveCalendarSettings()
updateCalendarSettings()
$id
$type
$user_id
$name
$description
$color
$admin_id
$status
$show_in_list
$public
$reminder_message_email
$reminder_message_popup
$access_key
$created_on
$updated_on
$db
$dbObj
$allCalendars
$calendarProperties
$language
$time_zone
$default_view
$shortdate_format
$longdate_format
$timeformat
$start_day
No constants found
No protected methods found
$errorNo
$errMsg
$errMsgList
N/A
No private methods found
No private properties found
N/A

Properties

$id

$id : integer

Type

integer — : calendar id

$type

$type : integer

Type

integer — : type of user

$user_id

$user_id : integer

Type

integer — : current logged in user id

$name

$name : string

Type

string — : calendar name

$description

$description : string

Type

string — : description of the calendar

$color

$color : string

Type

string — : color of the calendar

$admin_id

$admin_id : integer

Type

integer — : not in use in version 1.0.1

$status

$status : string

Type

string — : show/hide status of calendar

$show_in_list

$show_in_list : string

Type

string — : whether to show a calendar in the list or not

$public

$public : int

Type

int — : whether a calendar is set to public or not

$reminder_message_email

$reminder_message_email : string

Type

string — : reminder type as message email, not implemented in version 1.0.1

$reminder_message_popup

$reminder_message_popup : string

Type

string — : reminder type as message popup window, not implemented in version 1.0.1

$access_key

$access_key : string

Type

string — : not in use in this version 1.0.1

$created_on

$created_on : bool|string

Type

bool|string — : the date of a calendar that has been created

$updated_on

$updated_on : string

Type

string — : the date that a calendar has been updated, not implemented in this version 1.0.1

$db

$db

$dbObj

$dbObj

$allCalendars

$allCalendars : array|null

Type

array|null — : list of calendars

$calendarProperties

$calendarProperties : null

Type

null — : calendar properties

$language

$language : string

Type

string — , a set of languages can be setup, not in use in this version 1.0.1

$time_zone

$time_zone : string

Type

string — , a set of different timezones, not in use in this version 1.0.1

$default_view

$default_view : string

Type

string — , a set of views provided by full calendar Values: Month, Week, Day, Agenda

$shortdate_format

$shortdate_format : string

Type

string — , a set of date formats as short form of dates Formats: MM/dd/yyyy, dd/MM/yyyy, dd-MM-yyyy, MM-dd-yyyy, dd-MM-yy, MMM dd, yyyy

$longdate_format

$longdate_format

$timeformat

$timeformat

$start_day

$start_day : string

Type

string — , the first day of the week Values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday

$errorNo

$errorNo : int

Type

int — : error numbers

$errMsg

$errMsg : bool

Type

bool — : determines whether there is an error or not

$errMsgList

$errMsgList : array

Type

array — : list of error messages

Methods

__construct()

__construct()

Constructor function for this class

Description: No use of this

loadAllCalendars()

loadAllCalendars(integer $userID) : array|null

Loads all calendar for current logged in user

Parameters

integer $userID

current logged in user

Returns

array|null —

if any calendar is found then an array is returned, otherwise NULL will be returned

saveCalendar()

saveCalendar(array $params) : bool|integer

Saves a new calendar

While saving it finds the current logged in user from session.

Parameters

array $params

Returns

bool|integer —

on success returns inserted calendar id, otherwise returns a boolean false

editCalendar()

editCalendar(array $params, integer $id) : bool|integer

Edits a given calendar

Parameters

array $params
integer $id

Returns

bool|integer —

on success returns updated calendar id, otherwise returns a boolean false

loadCalendarSettings()

loadCalendarSettings( $userID) : null|\array,

Loads all calendar settings

Description: Loads all calendar settings for current logged in user

Parameters

$userID

Returns

null|\array, —

the set of current calendar settings for given user id

saveCalendarSettings()

saveCalendarSettings( $params) : bool|\integer,

Saves calendar settings

Description: Saves calendar settings based on user request

Parameters

$params

Returns

bool|\integer, —

if success returns the new calendar settings id, otherwise false

updateCalendarSettings()

updateCalendarSettings( $params,  $id) : bool|\integer,

Updates calendar settings

Description: Updates calendar settings based on user request

Parameters

$params
$id

Returns

bool|\integer, —

if success then returns calendar settings id, otherwise false