當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EntityListBuilder::getDefaultOperations方法代碼示例

本文整理匯總了PHP中Drupal\Core\Entity\EntityListBuilder::getDefaultOperations方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityListBuilder::getDefaultOperations方法的具體用法?PHP EntityListBuilder::getDefaultOperations怎麽用?PHP EntityListBuilder::getDefaultOperations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Entity\EntityListBuilder的用法示例。


在下文中一共展示了EntityListBuilder::getDefaultOperations方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getDefaultOperations

  /**
   * {@inheritdoc}
   */
  public function getDefaultOperations(EntityInterface $entity) {
    $operations = parent::getDefaultOperations($entity);

    $operations['edit']['title'] = $this->t('Edit items');

    return $operations;
  }
開發者ID:jkyto,項目名稱:agolf,代碼行數:10,代碼來源:EntitySubqueueListBuilder.php

示例2: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['query']['destination'] = 'admin/structure/block/block-content';
     }
     return $operations;
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:11,代碼來源:BlockContentListBuilder.php

示例3: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->access('update') && $entity->hasLinkTemplate('reassign-form')) {
         $operations['reassign'] = array('title' => $this->t('Reassign'), 'weight' => 20, 'url' => $entity->toUrl('reassign-form'));
     }
     return $operations;
 }
開發者ID:alexburrows,項目名稱:cream-2.x,代碼行數:11,代碼來源:OrderListBuilder.php

示例4: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['query']['destination'] = $entity->url('collection');
     }
     return $operations;
 }
開發者ID:nstielau,項目名稱:drops-8,代碼行數:11,代碼來源:BlockContentListBuilder.php

示例5: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['title'] = t('Edit');
     }
     $operations['view'] = array('title' => t('View'), 'url' => $entity->toUrl());
     return $operations;
 }
開發者ID:dakala,項目名稱:gradebook,代碼行數:12,代碼來源:GradeItemListBuilder.php

示例6: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     foreach (array_keys($operations) as $operation) {
         // This is a translation UI for translators. Show the translation
         // operation only.
         if (!($operation == 'translate')) {
             unset($operations[$operation]);
         }
     }
     return $operations;
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:15,代碼來源:ConfigTranslationEntityListBuilder.php

示例7: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\tmgmt_local\Entity\LocalTaskItem $entity */
     $operations = parent::getDefaultOperations($entity);
     if ($entity->access('view', \Drupal::currentUser()) && $entity->getTask()->getAssignee()->id() == \Drupal::currentUser()->id()) {
         if ($entity->isPending()) {
             $operations['translate'] = ['url' => $entity->urlInfo(), 'title' => t('Translate'), 'weight' => 0];
         } else {
             $operations['view'] = ['url' => $entity->urlInfo(), 'title' => t('View'), 'weight' => 0];
         }
     }
     return $operations;
 }
開發者ID:andrewl,項目名稱:andrewlnet,代碼行數:16,代碼來源:LocalTaskItemListBuilder.php

示例8: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->isSubmittable() && $entity->access('submit')) {
         $operations['submit'] = array('url' => $entity->urlInfo()->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Submit'), 'weight' => -10);
     } else {
         $operations['manage'] = array('url' => $entity->urlInfo()->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Manage'), 'weight' => -10);
     }
     if ($entity->isAbortable() && $entity->access('submit')) {
         $operations['abort'] = array('url' => $entity->urlInfo('abort-form')->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Abort'), 'weight' => 10);
     }
     return $operations;
 }
開發者ID:andrewl,項目名稱:andrewlnet,代碼行數:16,代碼來源:JobListBuilder.php

示例9: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     if ($this->entityType->hasKey('status')) {
         if (!$entity->status() && $entity->hasLinkTemplate('enable')) {
             $operations['enable'] = array('title' => t('Enable'), 'weight' => -10, 'url' => $entity->urlInfo('enable'));
         } elseif ($entity->hasLinkTemplate('disable')) {
             $operations['disable'] = array('title' => t('Disable'), 'weight' => 40, 'url' => $entity->urlInfo('disable'));
         }
     }
     return $operations;
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:16,代碼來源:ConfigEntityListBuilder.php

示例10: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->getCountTranslated() > 0 && $entity->access('accept')) {
         $operations['review'] = array('url' => $entity->urlInfo(), 'title' => t('Review'));
     } elseif (!$entity->getJob()->isUnprocessed()) {
         $operations['view'] = array('url' => $entity->urlInfo(), 'title' => t('View'));
     }
     // Display abort button on active or needs review job items.
     if ($entity->isActive() || $entity->isNeedsReview()) {
         $operations['abort'] = array('url' => $entity->urlInfo('abort-form')->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Abort'), 'weight' => 10);
     }
     return $operations;
 }
開發者ID:andrewl,項目名稱:andrewlnet,代碼行數:17,代碼來源:JobItemListBuilder.php

示例11: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['query']['destination'] = $entity->url('collection');
     }
     if (isset($operations['delete'])) {
         $operations['delete']['query']['destination'] = $entity->url('collection');
     }
     if ($entity->access('version-history') && $entity->hasLinkTemplate('version-history')) {
         $operations['version-history'] = ['title' => $this->t('Version history'), 'weight' => 10, 'url' => $entity->urlInfo('version-history')];
     }
     return $operations;
 }
開發者ID:heddn,項目名稱:content_entity_base,代碼行數:17,代碼來源:EntityBaseListBuilder.php

示例12: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     /* @var $transition WorkflowTransitionInterface */
     $transition = $entity;
     if (isset($operations['edit'])) {
         $destination = \Drupal::destination()->getAsArray();
         $operations['edit']['query'] = $destination;
     }
     return $operations;
 }
開發者ID:sedurzu,項目名稱:ildeposito8,代碼行數:14,代碼來源:WorkflowTransitionListBuilder.php

示例13: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     $destination = $this->redirectDestination->getAsArray();
     foreach ($operations as $key => $operation) {
         $operations[$key]['query'] = $destination;
     }
     return $operations;
 }
開發者ID:ravindrasingh22,項目名稱:Drupal-8-rc,代碼行數:12,代碼來源:NodeListBuilder.php

示例14: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     $operations['edit']['weight'] = 0;
     if ($entity->access('import') && $entity->hasLinkTemplate('import-form')) {
         $operations['import'] = ['title' => $this->t('Import'), 'weight' => 2, 'url' => $entity->urlInfo('import-form')];
     }
     if ($entity->access('clear') && $entity->hasLinkTemplate('clear-form')) {
         $operations['clear'] = ['title' => $this->t('Delete items'), 'weight' => 3, 'url' => $entity->urlInfo('clear-form')];
     }
     $destination = $this->redirectDestination->getAsArray();
     foreach ($operations as $key => $operation) {
         $operations[$key]['query'] = $destination;
     }
     return $operations;
 }
開發者ID:Tawreh,項目名稱:mtg,代碼行數:19,代碼來源:FeedListBuilder.php

示例15: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->access('view') && $entity->hasLinkTemplate('canonical')) {
         $operations['view'] = array('title' => $this->t('View'), 'weight' => 0, 'url' => $entity->urlInfo('canonical'));
     }
     return $operations;
 }
開發者ID:justincletus,項目名稱:webdrupalpro,代碼行數:11,代碼來源:RegistrationListBuilder.php


注:本文中的Drupal\Core\Entity\EntityListBuilder::getDefaultOperations方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。