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


PHP EntityInterface::getPlugin方法代码示例

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


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

示例1: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $entity->label();
     $definition = $entity->getPlugin()->getPluginDefinition();
     $row['plugin']['#markup'] = $definition['name'];
     $row['status']['#markup'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled');
     return $row + parent::buildRow($entity);
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:11,代码来源:PaymentMethodListBuilder.php

示例2: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $theme = $entity->getTheme();
     $plugin_definition = $entity->getPlugin()->getPluginDefinition();
     $row['label'] = array('data' => $entity->label(), 'class' => 'table-filter-text-source');
     $row['theme'] = array('data' => $this->themes[$theme]->info['name'], 'class' => 'table-filter-text-source');
     $row['category'] = array('data' => $plugin_definition['category'], 'class' => 'table-filter-text-source');
     $row['operations']['data'] = $this->buildOperations($entity);
     return $row;
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:13,代码来源:ConfigTranslationBlockListBuilder.php

示例3: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $entity->label();
     $row['id'] = $entity->id();
     $row['type'] = $entity->get('type');
     if ($plugin = $entity->getPlugin()) {
         $info = $plugin->getPluginDefinition();
         $row['type'] = $info['title'];
     }
     return $row + parent::buildRow($entity);
 }
开发者ID:r-daneelolivaw,项目名称:chalk,代码行数:14,代码来源:DestinationListBuilder.php

示例4: checkAccess

 /**
  * {@inheritdoc}
  */
 protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account)
 {
     /** @var $entity \Drupal\search\SearchPageInterface */
     if (in_array($operation, array('delete', 'disable')) && $entity->isDefaultSearch()) {
         return FALSE;
     }
     if ($operation == 'view') {
         if (!$entity->status()) {
             return FALSE;
         }
         $plugin = $entity->getPlugin();
         if ($plugin instanceof AccessibleInterface) {
             return $plugin->access($operation, $account);
         }
         return TRUE;
     }
     return parent::checkAccess($entity, $operation, $langcode, $account);
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:21,代码来源:SearchPageAccessController.php

示例5: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     /** @var $entity \Drupal\search\SearchPageInterface */
     $row['label'] = $entity->label();
     $row['url']['#markup'] = 'search/' . $entity->getPath();
     // If the search page is active, link to it.
     if ($entity->status()) {
         $row['url'] = array('#type' => 'link', '#title' => $row['url'], '#url' => Url::fromRoute('search.view_' . $entity->id()));
     }
     $definition = $entity->getPlugin()->getPluginDefinition();
     $row['plugin']['#markup'] = $definition['title'];
     if ($entity->isDefaultSearch()) {
         $status = $this->t('Default');
     } elseif ($entity->status()) {
         $status = $this->t('Enabled');
     } else {
         $status = $this->t('Disabled');
     }
     $row['status']['#markup'] = $status;
     if ($entity->isIndexable()) {
         $status = $entity->getPlugin()->indexStatus();
         $row['progress']['#markup'] = $this->t('%num_indexed of %num_total indexed', array('%num_indexed' => $status['total'] - $status['remaining'], '%num_total' => $status['total']));
     } else {
         $row['progress']['#markup'] = $this->t('Does not use index');
     }
     return $row + parent::buildRow($entity);
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:30,代码来源:SearchPageListBuilder.php

示例6: updateEntity

 /**
  * Updates the entity with the contents of a row.
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The search page entity.
  * @param \Drupal\migrate\Row $row
  *   The row object to update from.
  */
 protected function updateEntity(EntityInterface $entity, Row $row)
 {
     $entity->setPlugin($row->getDestinationProperty('plugin'));
     $entity->getPlugin()->setConfiguration($row->getDestinationProperty('configuration'));
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:13,代码来源:EntitySearchPage.php


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