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


PHP EntityInterface::getExecutable方法代码示例

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


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

示例1: view

 /**
  * {@inheritdoc}
  */
 public function view(EntityInterface $entity, $view_mode = 'full', $langcode = NULL)
 {
     $build = [];
     /** @var $entity \Drupal\page_manager\PageInterface */
     if ($display_variant = $entity->getExecutable()->selectDisplayVariant()) {
         $build = $display_variant->build();
     }
     return $build;
 }
开发者ID:pulibrary,项目名称:recap,代码行数:12,代码来源:PageViewBuilder.php

示例2: getDisplayPaths

 /**
  * Gets a list of paths assigned to the view.
  *
  * @param \Drupal\Core\Entity\EntityInterface $view
  *   The view entity.
  *
  * @return array
  *   An array of paths for this view.
  */
 protected function getDisplayPaths(EntityInterface $view)
 {
     $all_paths = array();
     $executable = $view->getExecutable();
     $executable->initDisplay();
     foreach ($executable->displayHandlers as $display) {
         if ($display->hasPath()) {
             $path = $display->getPath();
             if ($view->status() && strpos($path, '%') === FALSE) {
                 // @todo Views should expect and store a leading /. See:
                 //   https://www.drupal.org/node/2423913
                 $all_paths[] = \Drupal::l('/' . $path, Url::fromUserInput('/' . $path));
             } else {
                 $all_paths[] = '/' . $path;
             }
         }
     }
     return array_unique($all_paths);
 }
开发者ID:frankcr,项目名称:sftw8,代码行数:28,代码来源:ViewListBuilder.php

示例3: getDisplayPaths

 /**
  * Gets a list of paths assigned to the view.
  *
  * @param \Drupal\Core\Entity\EntityInterface $view
  *   The view entity.
  *
  * @return array
  *   An array of paths for this view.
  */
 protected function getDisplayPaths(EntityInterface $view)
 {
     $all_paths = array();
     $executable = $view->getExecutable();
     $executable->initDisplay();
     foreach ($executable->displayHandlers as $display) {
         if ($display->hasPath()) {
             $path = $display->getPath();
             if ($view->status() && strpos($path, '%') === FALSE) {
                 $all_paths[] = _l('/' . $path, $path);
             } else {
                 $all_paths[] = String::checkPlain('/' . $path);
             }
         }
     }
     return array_unique($all_paths);
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:26,代码来源:ViewListBuilder.php


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