\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()
$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

$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 used 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 : \database

Type

\database — object

$dbObj

$dbObj : \C_Database

Type

\C_Database — object

$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, int $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' {@source 255 2}

  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

int $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

loadAllCalendars()

loadAllCalendars(mixed $userID) : array|null

Loads all calendar for current logged in user

Parameters

mixed $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, mixed $id) : bool|integer

Edits a given calendar

Parameters

array $params
mixed $id

Returns

bool|integer —

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