public function Entity::__construct in Entity API 7
2 calls to Entity::__construct()
1 method overrides Entity::__construct()
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;
}
}