You are here

public function BatEventController::create in Booking and Availability Management Tools for Drupal 7

Create a event - we first set up the values that are specific to our event but then also go through the EntityAPIController function.

Parameters

array $values: The event to create properties.

Return value

object A event object with all default fields initialized.

Overrides EntityAPIController::create

File

modules/bat_event/bat_event.module, line 1303
Manage Events - Events store the EventValue of a Unit over a period of time.

Class

BatEventController
The Controller for BatEvent entities.

Code

public function create(array $values = array()) {
  $event_type = bat_event_type_load($values['type'], TRUE);

  // Add values that are specific to our event.
  $values += array(
    'event_id' => '',
    'is_new' => TRUE,
    'title' => '',
    'created' => '',
    'changed' => '',
    'data' => array(),
  );
  $event = parent::create($values);
  return $event;
}