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


PHP EntityTypeInterface::getRevisionTable方法代碼示例

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


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

示例1: processViewsDataForLanguage

 /**
  * Processes the views data for a language field.
  *
  * @param string $table
  *   The table the language field is added to.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The field definition.
  * @param array $views_field
  *   The views field data.
  * @param string $field_column_name
  *   The field column being processed.
  */
 protected function processViewsDataForLanguage($table, FieldDefinitionInterface $field_definition, array &$views_field, $field_column_name)
 {
     // Apply special titles for the langcode field.
     if ($field_definition->getName() == $this->entityType->getKey('langcode')) {
         if ($table == $this->entityType->getDataTable() || $table == $this->entityType->getRevisionDataTable()) {
             $views_field['title'] = $this->t('Translation language');
         }
         if ($table == $this->entityType->getBaseTable() || $table == $this->entityType->getRevisionTable()) {
             $views_field['title'] = $this->t('Original language');
         }
     }
 }
開發者ID:brstde,項目名稱:gap1,代碼行數:24,代碼來源:EntityViewsData.php

示例2: getRevisionViewsTableForEntityType

 /**
  * Gets the table of an entity type to be used as revision table in views.
  *
  * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  *   The entity type.
  *
  * @return string
  *   The revision base table.
  */
 protected function getRevisionViewsTableForEntityType(EntityTypeInterface $entity_type)
 {
     return $entity_type->getRevisionDataTable() ?: $entity_type->getRevisionTable();
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:13,代碼來源:ViewsData.php

示例3: hasSharedTableNameChanges

 /**
  * Detects whether any table name got renamed in an entity type update.
  *
  * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  *   The new entity type.
  * @param \Drupal\Core\Entity\EntityTypeInterface $original
  *   The origin entity type.
  *
  * @return bool
  *   Returns TRUE if there have been changes.
  */
 protected function hasSharedTableNameChanges(EntityTypeInterface $entity_type, EntityTypeInterface $original)
 {
     return $entity_type->getBaseTable() != $original->getBaseTable() || $entity_type->getDataTable() != $original->getDataTable() || $entity_type->getRevisionTable() != $original->getRevisionTable() || $entity_type->getRevisionDataTable() != $original->getRevisionDataTable();
 }
開發者ID:sgtsaughter,項目名稱:d8portfolio,代碼行數:15,代碼來源:SqlContentEntityStorageSchema.php

示例4: revisionRemoval

 /**
  * Updates views if revision support is removed
  *
  * @param \Drupal\views\Entity\View[] $all_views
  *   All views.
  * @param \Drupal\Core\Entity\EntityTypeInterface $original
  *   The origin entity type.
  */
 protected function revisionRemoval($all_views, EntityTypeInterface $original)
 {
     $revision_base_table = $original->getRevisionTable();
     $revision_data_table = $original->getRevisionDataTable();
     foreach ($all_views as $view) {
         if (in_array($view->get('base_table'), [$revision_base_table, $revision_data_table])) {
             // Let's disable the views as we no longer support revisions.
             $view->setStatus(FALSE);
         }
         // For any kind of field, let's rely on the broken handler functionality.
     }
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:20,代碼來源:ViewsEntitySchemaSubscriber.php


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