protected ConfigEntityStorage::_doCreateFromStorageRecord(array $values, $is_syncing = FALSE)
Helps create a configuration entity from storage values.
Allows the configuration entity storage to massage storage values before creating an entity.
Parameters
array $values: The array of values from the configuration storage.
bool $is_syncing: Is the configuration entity being created as part of a config sync.
Return value
ConfigEntityInterface The configuration entity.
See also
\Drupal\Core\Config\Entity\ConfigEntityStorageInterface::createFromStorageRecord()
\Drupal\Core\Config\Entity\ImportableEntityStorageInterface::importCreate()
File
- core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php, line 447
Class
- ConfigEntityStorage
- Defines the storage class for configuration entities.
Namespace
Drupal\Core\Config\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | protected function _doCreateFromStorageRecord( array $values , $is_syncing = FALSE) { // Assign a new UUID if there is none yet. if ( $this ->uuidKey && $this ->uuidService && !isset( $values [ $this ->uuidKey])) { $values [ $this ->uuidKey] = $this ->uuidService->generate(); } $data = $this ->mapFromStorageRecords( array ( $values )); $entity = current( $data ); $entity ->original = clone $entity ; $entity ->setSyncing( $is_syncing ); $entity ->enforceIsNew(); $entity ->postCreate( $this ); // Modules might need to add or change the data initially held by the new // entity object, for instance to fill-in default values. $this ->invokeHook( 'create' , $entity ); return $entity ; } |
Please login to continue.