ePages 6.11.0 - DE_EPAGES/Calendar/API/Object/Calendar.pm

Package DE_EPAGES::Calendar::API::Object::Calendar

object interface for Calendar.

Base
DE_EPAGES::Object::API::Object::Object

Functions

appointmentInterval
businessMinutes
className
clone
dayList
dbPackage
defaultDuration
getRemainingQuantity
isBusiness
isBusy
isLocked
nextAppointmentNo
removeBookingPeriods
removeLockingPeriods
setBookingPeriods
setLock

appointmentInterval

Returns interval for appointments in minutes (uses BaseCalendar if AppointmentInterval isnt defined at this calendar).

Syntax
$Interval = $Calendar->appointmentInterval;
Return
$Interval (int)
interval (default 30)

businessMinutes

get booking periods formated to minutes for the given day.

Syntax
$aaMinutes = $Calendar->businessMinutes( $Date );
Input
$Date (DateTime)
requested day
Return
$aaMinutes (ref.array.array.int)
list of open periods in (minutes),
  • 0 - start time in minutes - int
  • 1 - end time in minutes - int

className

Returns the class name, used for DAL access.

Syntax
$ClassName = $Calendar->className;
Return
$ClassName (String)
class name

clone

Inserts a new object into the database as copy from old object, dont clones appointments.

Syntax
$Clone = $Object->clone( $hInfo );
$Clone = $Object->clone( $hInfo, $Recursive );
Input
$hInfo (hash ref)
hash with attribute values that are different in the clone object.
Note that the clone cannot have the same Parent and the same Alias.
$Recursive (boolean)
clone child object too (optional, default is false)
Return
$Clone (object)
the new object

dayList

Returns day list for TLE function (AppointmentDayList).

Syntax
$ahDayList = $Calendar->dayList( $Date );
Input
$Date (DateTime)
requested day
Return
$aaMinutes (ref.array.array.int)
list of open periods in (minutes),
  • Minute - minutes since 00:00- int
  • StartDate - start date time - DateTime
  • EndDate - start date time - DateTime
  • Appointments - list of appointments - ref.array.object
  • IsBookingHours - in business hours - boolean
  • IsLocked - is locked - boolean
  • IsOpened - is opened - boolean
  • IsBusiness - is open for business (IsBookingHours && !IsLocked || IsOpened) - boolean

dbPackage

Returns the database package, used for DAL access.

Syntax
$DbPackage = $Calendar->dbPackage;
Return
$DbPackage (String)
database package name

defaultDuration

Return default duration.

Syntax
$Calendar->defaultDuration;
Return
$DurationUnit (object)
unit of measurement
$DurationAmount (integer)
amount

getRemainingQuantity

Returns remaining quantity of given period

Syntax
$Calendar->isBusy($StartDate, $EndDate, $Requested, $Available);
Input
$StartDate (DateTime)
start date time of new appointment
$EndDate (DateTime)
end date time of new appointment
$Available (float)
available elements
Return
$RemainingQuantity (integer)
amount

isBusiness

Returns true if on period of time is open for business (including locks).

Syntax
$IsBusiness = $Calendar->isBusiness( $StartDate, $EndDate, $BusinessMinutes );
Input
$StartDate (DateTime)
start time
$EndDate (DateTime)
end time (default StartTime + 1 Second)
$BusinessMinutes (DateTime)
result of <func businessMinutes> performance optimization for multiple calls (optional)
Return
$IsBusiness (boolean)
is open or not

isBusy

Return default duration.

Syntax
$Calendar->isBusy($StartDate, $EndDate, $Requested, $Available);
Input
$StartDate (DateTime)
start date time of new appointment
$EndDate (DateTime)
end date time of new appointment
$Requested (float)
requested elements at new appointment
$Available (float)
available elements
Return
$IsBusy (boolean)
free or not

isLocked

Returns true if on period of time is locked.

Syntax
$IsLocked = $Calendar->isLocked( $StartDate, $EndDate );
Input
$StartDate (DateTime)
start time
$EndDate (DateTime)
end time (default StartTime + 1 Second)
Return
$IsLocked (boolean)
is there a lock or not

nextAppointmentNo

Returns the next appointment alias.

Syntax
$AppointmentNo = $Calendar->nextAppointmentNo;
Return
$AppointmentNo (string)
alias string for appointment

removeBookingPeriods

Removes all booking periods of this calendar (to use base calendar).

Syntax
$Calendar->removeBookingPeriods;

removeLockingPeriods

Removes all locking periods of this calendar (to use booking periods).

Syntax
$Calendar->removeLockingPeriods;

setBookingPeriods

set booking periods for each day.

Syntax
$Calendar->setBookingPeriods( $ahData );
Input
$ahData (ref.array.hash)
list of weekdays, keys
  • IsOddWeek - odd/even week - boolean
  • WeekDay - week day (0 sunday, 1 monday, ...) - int
  • OpeningTime - open at this time - DateTime
  • ClosingTime - close at this time - DateTime

setLock

Add a lock period to the calendar, the existing periods could be change if there are some overlaps.

Syntax
$Calendar->setLock( $hLockPeriod );
Input
$hLockPeriod (ref.hash)
period, parameter keys :
  • StartDate - start datetime - DateTime
  • EndDate - end datetime - DateTime
  • IsLocked - is locked or - boolean