Implements the magic method for getting object properties.
Directly accesses the plain field values, as done in Drupal 7.
Overrides EntityBCDecorator::__get
public function &__get($name) {
// Special handling for roles, as the return value is expected to be an
// array.
if ($name == 'roles') {
$roles = $this->decorated
->getRoles();
return $roles;
}
return parent::__get($name);
}