You are here

protected function EntityDateFormat::updateEntityProperty in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php \Drupal\system\Plugin\migrate\destination\EntityDateFormat::updateEntityProperty()

Updates a (possible nested) entity property with a value.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The config entity.

array $parents: The array of parents.

string|object $value: The value to update to.

Overrides EntityConfigBase::updateEntityProperty

File

core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php, line 19

Class

EntityDateFormat
Plugin annotation @MigrateDestination( id = "entity:date_format" )

Namespace

Drupal\system\Plugin\migrate\destination

Code

protected function updateEntityProperty(EntityInterface $entity, array $parents, $value) {
  assert($entity instanceof DateFormatInterface);
  if ($parents[0] == 'pattern') {
    $entity
      ->setPattern($value);
  }
  else {
    parent::updateEntityProperty($entity, $parents, $value);
  }
}