You are here

public function EckController::create in Entity Construction Kit (ECK) 7

Implements EntityAPIControllerInterface.

Overrides EntityAPIController::create

File

./eck.module, line 358
ENTITY CONSTRUCTION KIT

Class

EckController
Base controller class for ECK entites.

Code

public function create(array $values = array()) {
  global $user;

  // Set default values.
  $values += array(
    'type' => $this->entityType,
    'uid' => $user->uid,
    'created' => REQUEST_TIME,
    'changed' => REQUEST_TIME,
  );

  // Allow to create custom per-bundle specific class implementations.
  $class_name = eck_get_class_name($values['type'], 'EntityType');
  if (drupal_autoload_class($class_name)) {
    $this->entityInfo['entity class'] = $class_name;
  }
  return parent::create($values);
}