\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()
loadCalendarSettings()
saveCalendarSettings()
updateCalendarSettings()
loadAllCalendars()
getFirstCalendarID()
loadSingleCalendarData()
saveCalendar()
editCalendar()
$language
$time_zone
$default_view
$shortdate_format
$longdate_format
$timeformat
$start_day
$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
No constants found
No protected methods found
$errorNo
$errMsg
$errMsgList
N/A
No private methods found
No private properties found
N/A

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

$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

$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(mixed $name, string $description, string $color, string $type, string $status, string $show_in_list, integer $public, string $reminder_message_email, string $reminder_message_popup, string $access_key, string $created_on, string $updated_on)

Constructor function for this class

Description: This class can be constructed using calendar properties.

During creating an instance of this class using this constructor following things can be happened:

  1. Default Calendar Parameters for creating/editing, $name='ANYTHING'

  2. Loading My Calendars, Ex: $name = 'LOAD_MY_CALENDARS'

  3. Loading Current Calendar's Properties, Ex: $name = 'LOAD_CALENDAR_PROPERTIES'

  4. Updating Current Calendar's Properties, Ex: $name = 'UPDATE_CALENDAR_PROPERTIES'

Parameters

mixed $name

name of the calendar, required

string $description

description of the calendar, required

string $color

color of the calendar, default: #3a87ad

string $type

user type, default: user

string $status

current status for the calendar, default: on

string $show_in_list

whether to show the calendar in the list, not implemented in version 1.0.1

integer $public

whether it is public or private, not implemented in version 1.0.1

string $reminder_message_email

reminder type as email message, not implemented in version 1.0.1

string $reminder_message_popup

reminder type as popup message, not implemented in version 1.0.1

string $access_key

not implemented in this version 1.0.1

string $created_on

created date of the calendar, default: current date

string $updated_on

updated date of the calendar, not implemented in this version 1.0.1

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

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

getFirstCalendarID()

getFirstCalendarID( $userID)

Parameters

$userID

loadSingleCalendarData()

loadSingleCalendarData(mixed $calID) : mixed|null

Loads Single Calendar Data

Parameters

mixed $calID

Returns

mixed|null

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