本文整理匯總了PHP中Drupal\Core\Config\Entity\ConfigEntityInterface::uuid方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigEntityInterface::uuid方法的具體用法?PHP ConfigEntityInterface::uuid怎麽用?PHP ConfigEntityInterface::uuid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Config\Entity\ConfigEntityInterface
的用法示例。
在下文中一共展示了ConfigEntityInterface::uuid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: assertConfigEntityImport
/**
* Asserts that a config entity can be imported without changing it.
*
* @param \Drupal\Core\Config\Entity\ConfigEntityInterface $entity
* The config entity to test importing.
*/
public function assertConfigEntityImport(ConfigEntityInterface $entity)
{
// Save original config information.
$entity_uuid = $entity->uuid();
$entity_type_id = $entity->getEntityTypeId();
$original_data = $entity->toArray();
// Copy everything to sync.
$this->copyConfig(\Drupal::service('config.storage'), \Drupal::service('config.storage.sync'));
// Delete the configuration from active. Don't worry about side effects of
// deleting config like fields cleaning up field storages. The coming import
// should recreate everything as necessary.
$entity->delete();
$this->configImporter()->reset()->import();
$imported_entity = \Drupal::entityManager()->loadEntityByUuid($entity_type_id, $entity_uuid);
$this->assertIdentical($original_data, $imported_entity->toArray());
}