function availability_calendar_create_calendar in Availability Calendars 7.3
Same name and namespace in other branches
- 7.5 availability_calendar.inc \availability_calendar_create_calendar()
- 7.4 availability_calendar.inc \availability_calendar_create_calendar()
Creates a new calendar an returns its id (the "cid").
Return value
int The cid of the newly created calendar.
1 call to availability_calendar_create_calendar()
- availability_calendar_update_multiple_availability in ./
availability_calendar.inc - Updates/inserts the states for the given ranges.
File
- ./
availability_calendar.inc, line 364 - General helper methods for Availability Calendar
Code
function availability_calendar_create_calendar() {
$now = time();
$cid = db_insert('availability_calendar_calendar')
->fields(array(
'created' => $now,
'changed' => $now,
))
->execute();
return (int) $cid;
}