當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EntityTypeInterface::getStorageClass方法代碼示例

本文整理匯總了PHP中Drupal\Core\Entity\EntityTypeInterface::getStorageClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityTypeInterface::getStorageClass方法的具體用法?PHP EntityTypeInterface::getStorageClass怎麽用?PHP EntityTypeInterface::getStorageClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Entity\EntityTypeInterface的用法示例。


在下文中一共展示了EntityTypeInterface::getStorageClass方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: requiresEntityDataMigration

 /**
  * {@inheritdoc}
  */
 public function requiresEntityDataMigration(EntityTypeInterface $entity_type, EntityTypeInterface $original)
 {
     // If the original storage has existing entities, or it is impossible to
     // determine if that is the case, require entity data to be migrated.
     $original_storage_class = $original->getStorageClass();
     if (!class_exists($original_storage_class)) {
         return TRUE;
     }
     // Data migration is not needed when only indexes changed, as they can be
     // applied if there is data.
     if (!$this->hasSharedTableStructureChange($entity_type, $original)) {
         return FALSE;
     }
     // Use the original entity type since the storage has not been updated.
     $original_storage = $this->entityManager->createHandlerInstance($original_storage_class, $original);
     return $original_storage->hasData();
 }
開發者ID:sgtsaughter,項目名稱:d8portfolio,代碼行數:20,代碼來源:SqlContentEntityStorageSchema.php

示例2: requiresEntityDataMigration

 /**
  * {@inheritdoc}
  */
 public function requiresEntityDataMigration(EntityTypeInterface $entity_type, EntityTypeInterface $original)
 {
     // If we're updating from NULL storage, then there's no stored data that
     // requires migration.
     // @todo Remove in https://www.drupal.org/node/2335879.
     $original_storage_class = $original->getStorageClass();
     $null_storage_class = 'Drupal\\Core\\Entity\\ContentEntityNullStorage';
     if ($original_storage_class == $null_storage_class || is_subclass_of($original_storage_class, $null_storage_class)) {
         return FALSE;
     }
     return $entity_type->getStorageClass() != $original_storage_class || !$this->isTableEmpty($this->storage->getBaseTable());
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:15,代碼來源:SqlContentEntityStorageSchema.php


注:本文中的Drupal\Core\Entity\EntityTypeInterface::getStorageClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。