public ConfigEntityStorage::updateFromStorageRecord(ConfigEntityInterface $entity, array $values)
Updates a configuration entity from storage values.
Allows the configuration entity storage to massage storage values before updating an entity.
ConfigEntityInterface $entity: The configuration entity to update.
array $values: The array of values from the configuration storage.
ConfigEntityInterface The configuration entity.
Overrides ConfigEntityStorageInterface::updateFromStorageRecord
\Drupal\Core\Entity\EntityStorageBase::mapFromStorageRecords()
\Drupal\field\FieldStorageConfigStorage::mapFromStorageRecords()
public function updateFromStorageRecord(ConfigEntityInterface $entity, array $values) { $entity->original = clone $entity; $data = $this->mapFromStorageRecords(array($values)); $updated_entity = current($data); foreach (array_keys($values) as $property) { $value = $updated_entity->get($property); $entity->set($property, $value); } return $entity; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!Entity!ConfigEntityStorage.php/function/ConfigEntityStorage::updateFromStorageRecord/8.1.x