当前位置: 首页>>代码示例>>PHP>>正文


PHP EntityTypeInterface::getRevisionDataTable方法代码示例

本文整理汇总了PHP中Drupal\Core\Entity\EntityTypeInterface::getRevisionDataTable方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityTypeInterface::getRevisionDataTable方法的具体用法?PHP EntityTypeInterface::getRevisionDataTable怎么用?PHP EntityTypeInterface::getRevisionDataTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\Entity\EntityTypeInterface的用法示例。


在下文中一共展示了EntityTypeInterface::getRevisionDataTable方法的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::getRevisionDataTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。