本文整理汇总了PHP中Drupal\Core\Entity\EntityTypeInterface::getBundleOf方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityTypeInterface::getBundleOf方法的具体用法?PHP EntityTypeInterface::getBundleOf怎么用?PHP EntityTypeInterface::getBundleOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Entity\EntityTypeInterface
的用法示例。
在下文中一共展示了EntityTypeInterface::getBundleOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Creates a new NodeType instance.
*
* @param EntityManagerInterface $entity_manager
* The entity manager.
* @param array $configuration
* The plugin configuration, i.e. an array with configuration values keyed
* by configuration option name. The special key 'context' may be used to
* initialize the defined contexts by setting it to an array of context
* values keyed by context names.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
*/
public function __construct(EntityManagerInterface $entity_manager, array $configuration, $plugin_id, $plugin_definition)
{
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityStorage = $entity_manager->getStorage($this->getDerivativeId());
$this->bundleType = $entity_manager->getDefinition($this->getDerivativeId());
$this->bundleOf = $entity_manager->getDefinition($this->bundleType->getBundleOf());
}