You are here

public function EntityAPIController::create in Entity API 7

Implements EntityAPIControllerInterface.

Overrides EntityAPIControllerInterface::create

1 call to EntityAPIController::create()
EntityAPIController::import in includes/entity.controller.inc
Implements EntityAPIControllerInterface.

File

includes/entity.controller.inc, line 543
Provides a controller building upon the core controller but providing more features like full CRUD functionality.

Class

EntityAPIController
A controller implementing EntityAPIControllerInterface for the database.

Code

public function create(array $values = array()) {

  // Add is_new property if it is not set.
  $values += array(
    'is_new' => TRUE,
  );
  if (isset($this->entityInfo['entity class']) && ($class = $this->entityInfo['entity class'])) {
    return new $class($values, $this->entityType);
  }
  return (object) $values;
}