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


PHP EntityStorageInterface::getEntityType方法代码示例

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


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

示例1: testUntranslatable

 /**
  * Test that translation destination fails for untranslatable entities.
  *
  * @expectedException \Drupal\migrate\MigrateException
  * @expectedExceptionMessage This entity type does not support translation
  */
 public function testUntranslatable()
 {
     // An entity type without a language.
     $entity_type = $this->prophesize(ContentEntityType::class);
     $entity_type->getKey('langcode')->willReturn('');
     $entity_type->getKey('id')->willReturn('id');
     $this->storage->getEntityType()->willReturn($entity_type->reveal());
     $destination = new EntityTestDestination(['translations' => TRUE], '', [], $this->migration->reveal(), $this->storage->reveal(), [], $this->entityManager->reveal(), $this->prophesize(FieldTypePluginManagerInterface::class)->reveal());
     $destination->getIds();
 }
开发者ID:DrupalCamp-NYC,项目名称:dcnyc16,代码行数:16,代码来源:EntityContentBaseTest.php

示例2: testGetEntityLoadFailure

 /**
  * Test entity load failure.
  *
  * @covers ::getEntity
  */
 public function testGetEntityLoadFailure()
 {
     $destination = $this->getEntityRevisionDestination([]);
     $entity_type = $this->prophesize('\\Drupal\\Core\\Entity\\EntityTypeInterface');
     $entity_type->getKey('id')->willReturn('nid');
     $entity_type->getKey('revision')->willReturn('vid');
     $this->storage->getEntityType()->willReturn($entity_type->reveal());
     // Return a failed load and make sure we don't fail and we return FALSE.
     $this->storage->load(1)->shouldBeCalled()->willReturn(FALSE);
     $row = new Row(['nid' => 1, 'vid' => 2], ['nid' => 1, 'vid' => 2]);
     $row->setDestinationProperty('nid', 1);
     $this->assertFalse($destination->getEntity($row, []));
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:18,代码来源:EntityRevisionTest.php

示例3: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     static::invalidateTagsOnDelete($storage->getEntityType(), $entities);
 }
开发者ID:jeyram,项目名称:camp-gdl,代码行数:7,代码来源:Entity.php

示例4: calculateDependencies

 /**
  * {@inheritdoc}
  */
 public function calculateDependencies()
 {
     $this->addDependency('module', $this->storage->getEntityType()->getProvider());
     return $this->dependencies;
 }
开发者ID:nsp15,项目名称:Drupal8,代码行数:8,代码来源:Entity.php

示例5: getKey

 /**
  * Returns a specific entity key.
  *
  * @param string $key
  *   The name of the entity key to return.
  *
  * @return string|bool
  *   The entity key, or FALSE if it does not exist.
  *
  * @see \Drupal\Core\Entity\EntityTypeInterface::getKeys()
  */
 protected function getKey($key)
 {
     return $this->storage->getEntityType()->getKey($key);
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:15,代码来源:Entity.php

示例6: sortSearchPages

 /**
  * {@inheritdoc}
  */
 public function sortSearchPages($search_pages)
 {
     $entity_type = $this->storage->getEntityType();
     uasort($search_pages, array($entity_type->getClass(), 'sort'));
     return $search_pages;
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:9,代码来源:SearchPageRepository.php


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