本文整理匯總了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());
}