本文整理汇总了PHP中Drupal\Core\Entity\EntityManagerInterface::hasController方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityManagerInterface::hasController方法的具体用法?PHP EntityManagerInterface::hasController怎么用?PHP EntityManagerInterface::hasController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Entity\EntityManagerInterface
的用法示例。
在下文中一共展示了EntityManagerInterface::hasController方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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->hasController($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($base_table), 'entity_type' => $entity_type_id, 'display_types' => array('normal'), 'class' => $base_plugin_definition['class']);
}
}
return $this->derivatives;
}
示例2: applies
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match)
{
return $this->entityManager->hasController('user_role', 'storage') && $this->user->hasPermission('view the administration theme') && $this->adminContext->isAdminRoute($route_match->getRouteObject());
}