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


PHP EntityTypeInterface::getBaseTable方法代码示例

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


在下文中一共展示了EntityTypeInterface::getBaseTable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->entityTypeId = $this->definition['entity_type'];
     $this->entityType = $this->entityManager->getDefinition($this->entityTypeId);
     $this->base_table = $this->entityType->getDataTable() ?: $this->entityType->getBaseTable();
     $this->base_field = $this->entityType->getKey('id');
 }
开发者ID:HakS,项目名称:drupal8_training,代码行数:11,代码来源:EntityRow.php

示例2: 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

示例3: onEntityTypeDelete

 /**
  * {@inheritdoc}
  */
 public function onEntityTypeDelete(EntityTypeInterface $entity_type)
 {
     $tables = [$entity_type->getBaseTable(), $entity_type->getDataTable(), $entity_type->getRevisionTable(), $entity_type->getRevisionDataTable()];
     $all_views = $this->entityManager->getStorage('view')->loadMultiple(NULL);
     /** @var \Drupal\views\Entity\View $view */
     foreach ($all_views as $id => $view) {
         // First check just the base table.
         if (in_array($view->get('base_table'), $tables)) {
             $view->disable();
             $view->save();
         }
     }
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:16,代码来源:ViewsEntitySchemaSubscriber.php

示例4: testGetViewsDataWithEntityOperations

 /**
  * @covers ::getViewsData
  */
 public function testGetViewsDataWithEntityOperations()
 {
     $this->baseEntityType->setListBuilderClass('\\Drupal\\Core\\Entity\\EntityListBuilder');
     $data = $this->viewsData->getViewsData();
     $this->assertSame('entity_operations', $data[$this->baseEntityType->getBaseTable()]['operations']['field']['id']);
 }
开发者ID:frankcr,项目名称:sftw8,代码行数:9,代码来源:EntityViewsDataTest.php

示例5: getViewsTableForEntityType

 /**
  * Gets the table of an entity type to be used as base table in views.
  *
  * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  *   The entity type.
  *
  * @return string
  *   The name of the base table in views.
  */
 protected function getViewsTableForEntityType(EntityTypeInterface $entity_type)
 {
     return $entity_type->getDataTable() ?: $entity_type->getBaseTable();
 }
开发者ID:brstde,项目名称:gap1,代码行数:13,代码来源:EntityViewsData.php


注:本文中的Drupal\Core\Entity\EntityTypeInterface::getBaseTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。