本文整理匯總了PHP中Drupal\Core\Entity\EntityManagerInterface::hasHandler方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityManagerInterface::hasHandler方法的具體用法?PHP EntityManagerInterface::hasHandler怎麽用?PHP EntityManagerInterface::hasHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Entity\EntityManagerInterface
的用法示例。
在下文中一共展示了EntityManagerInterface::hasHandler方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDerivativeDefinitions
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition)
{
foreach ($this->entityManager->getDefinitions() as $entity_type_id => $entity_type) {
// Just add support for entity types which have a views integration.
if (($base_table = $entity_type->getBaseTable()) && $this->viewsData->get($base_table) && $this->entityManager->hasHandler($entity_type_id, 'view_builder')) {
$this->derivatives[$entity_type_id] = array('id' => 'entity:' . $entity_type_id, 'provider' => 'views', 'title' => $entity_type->getLabel(), 'help' => t('Display the @label', array('@label' => $entity_type->getLabel())), 'base' => array($entity_type->getDataTable() ?: $entity_type->getBaseTable()), 'entity_type' => $entity_type_id, 'display_types' => array('normal'), 'class' => $base_plugin_definition['class']);
}
}
return $this->derivatives;
}
示例2: calculateDependencies
/**
* {@inheritdoc}
*/
public function calculateDependencies()
{
$dependencies = parent::calculateDependencies();
$entity_type_id = $this->definition['entity_type'];
$bundle_entity_type = $this->entityManager->getDefinition($entity_type_id)->getBundleEntityType();
// The bundle entity type might not exist. For example, users do not have
// bundles.
if ($this->entityManager->hasHandler($bundle_entity_type, 'storage')) {
$bundle_entity_storage = $this->entityManager->getStorage($bundle_entity_type);
foreach ($bundle_entity_storage->loadMultiple(array_keys($this->options['bundles'])) as $bundle_entity) {
$dependencies[$bundle_entity->getConfigDependencyKey()][] = $bundle_entity->getConfigDependencyName();
}
}
return $dependencies;
}
示例3: applies
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match)
{
return $this->entityManager->hasHandler('user_role', 'storage') && $this->user->hasPermission('view the administration theme') && $this->adminContext->isAdminRoute($route_match->getRouteObject());
}
示例4: hasHandler
/**
* {@inheritdoc}
*/
public function hasHandler($entity_type, $handler_type)
{
return $this->entityManager->hasHandler($entity_type, $handler_type);
}