Overrides \Drupal\Core\TypedData\TypedData::__construct().
Overrides TypedData::__construct
public function __construct(array $definition, $name = NULL, TypedDataInterface $parent = NULL) {
parent::__construct($definition, $name, $parent);
// Initialize computed properties by default, such that they get cloned
// with the whole item.
foreach ($this
->getPropertyDefinitions() as $name => $definition) {
if (!empty($definition['computed'])) {
$this->properties[$name] = \Drupal::typedData()
->getPropertyInstance($this, $name);
}
}
}