Overrides Entity::__construct().
Overrides Entity::__construct
public function __construct(array $values, $entity_type, $bundle = FALSE) {
$this->entityType = $entity_type;
$this->bundle = $bundle ? $bundle : $this->entityType;
foreach ($values as $key => $value) {
// If the key matches an existing property set the value to the property
// to ensure non converted properties have the correct value.
if (property_exists($this, $key) && isset($value[Language::LANGCODE_DEFAULT])) {
$this->{$key} = $value[Language::LANGCODE_DEFAULT];
}
$this->values[$key] = $value;
}
$this
->init();
}