You are here

public function Entity::__construct in Entity API 7

2 calls to Entity::__construct()
EntityClass::__construct in tests/entity_test.module
EntityClassRevision::__construct in tests/entity_test.module
1 method overrides Entity::__construct()
EntityClass::__construct in tests/entity_test.module

File

includes/entity.inc, line 202
Provides a base class for entities.

Class

Entity
A common class for entities.

Code

public function __construct(array $values = array(), $entityType = NULL) {
  if (empty($entityType)) {
    throw new Exception('Cannot create an instance of Entity without a specified entity type.');
  }
  $this->entityType = $entityType;
  $this
    ->setUp();

  // Set initial values.
  foreach ($values as $key => $value) {
    $this->{$key} = $value;
  }
}