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


PHP DefaultPluginManager::processDefinition方法代碼示例

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


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

示例1: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     if (!isset($definition['list_class'])) {
         $definition['list_class'] = '\\Drupal\\Core\\Field\\FieldItemList';
     }
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:10,代碼來源:FieldTypePluginManager.php

示例2: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     // Assign a default time if a cron is specified.
     if (isset($definition['cron'])) {
         $definition['cron'] += ['time' => 15];
     }
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:11,代碼來源:QueueWorkerManager.php

示例3: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     // Ensure that every block has a category.
     if (empty($definition['category'])) {
         $definition['category'] = $this->getModuleName($definition['provider']);
     }
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:11,代碼來源:BlockManager.php

示例4: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     foreach (['description', 'label'] as $key) {
         if (isset($definition[$key])) {
             $definition[$key] = new TranslatableMarkup($definition[$key], [], [], $this->stringTranslation);
         }
     }
 }
開發者ID:nishantkumar155,項目名稱:drupal8.crackle,代碼行數:12,代碼來源:PaymentStatusManager.php

示例5: processDefinition

 /**
  * Overrides \Drupal\Component\Plugin\PluginManagerBase::processDefinition().
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     if (isset($this->methodConfig[$plugin_id]['status'])) {
         $definition['checkout'] = $this->methodConfig[$plugin_id]['status'];
     }
     if (isset($this->methodConfig[$plugin_id]['weight'])) {
         $definition['weight'] = $this->methodConfig[$plugin_id]['weight'];
     }
 }
開發者ID:pedrocones,項目名稱:hydrotools,代碼行數:13,代碼來源:PaymentMethodManager.php

示例6: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     if (!isset($definition['context'])) {
         $definition['context'] = [];
     }
     // Convert the flat context arrays into ContextDefinition objects.
     foreach ($definition['context'] as $context_name => $values) {
         $definition['context'][$context_name] = ContextDefinition::createFromArray($values);
     }
 }
開發者ID:DrupalTV,項目名稱:DrupalTV,代碼行數:14,代碼來源:RulesEventManager.php

示例7: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     /** @var \Drupal\Core\Entity\EntityTypeInterface $definition */
     parent::processDefinition($definition, $plugin_id);
     // All link templates must have a leading slash.
     foreach ((array) $definition->getLinkTemplates() as $link_relation_name => $link_template) {
         if ($link_template[0] != '/') {
             throw new InvalidLinkTemplateException("Link template '{$link_relation_name}' for entity type '{$plugin_id}' must start with a leading slash, the current link template is '{$link_template}'");
         }
     }
 }
開發者ID:frankcr,項目名稱:sftw8,代碼行數:14,代碼來源:EntityTypeManager.php

示例8: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     // Allow custom groups and therefore more than one group per extension.
     if (empty($definition['group'])) {
         $definition['group'] = $definition['provider'];
     }
     // Ensure a 1x multiplier exists.
     if (!in_array('1x', $definition['multipliers'])) {
         $definition['multipliers'][] = '1x';
     }
     // Ensure that multipliers are sorted correctly.
     sort($definition['multipliers']);
 }
開發者ID:andypost,項目名稱:jcaurucel,代碼行數:17,代碼來源:jCarouselSkinsManager.php

示例9: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     // Add the module or theme path to the 'path'.
     if ($this->moduleHandler->moduleExists($definition['provider'])) {
         $definition['provider_type'] = 'module';
         $base_path = $this->moduleHandler->getModule($definition['provider'])->getPath();
     } elseif ($this->themeHandler->themeExists($definition['provider'])) {
         $definition['provider_type'] = 'theme';
         $base_path = $this->themeHandler->getTheme($definition['provider'])->getPath();
     } else {
         $base_path = '';
     }
     $definition['path'] = !empty($definition['path']) ? $base_path . '/' . $definition['path'] : $base_path;
     // Add the path to the icon filename.
     if (!empty($definition['icon'])) {
         $definition['icon'] = $definition['path'] . '/' . $definition['icon'];
     }
     // If 'template' is set, then we'll derive 'template_path' and 'theme'.
     if (!empty($definition['template'])) {
         $template_parts = explode('/', $definition['template']);
         $definition['template'] = array_pop($template_parts);
         $definition['theme'] = strtr($definition['template'], '-', '_');
         $definition['template_path'] = $definition['path'];
         if (count($template_parts) > 0) {
             $definition['template_path'] .= '/' . implode('/', $template_parts);
         }
     }
     // If 'css' is set, then we'll derive 'library'.
     if (!empty($definition['css'])) {
         $definition['css'] = $definition['path'] . '/' . $definition['css'];
         $definition['library'] = 'layout_plugin/' . $plugin_id;
     }
     // Generate the 'region_names' key from the 'regions' key.
     $definition['region_names'] = array();
     if (!empty($definition['regions']) && is_array($definition['regions'])) {
         foreach ($definition['regions'] as $region_id => $region_definition) {
             $definition['region_names'][$region_id] = $region_definition['label'];
         }
     }
 }
開發者ID:AllieRays,項目名稱:debugging-drupal-8,代碼行數:44,代碼來源:LayoutPluginManager.php

示例10: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     // Add plugin_type key so that we can determie the plugin type later.
     $definition['plugin_type'] = $this->pluginType;
 }
開發者ID:Tawreh,項目名稱:mtg,代碼行數:9,代碼來源:FeedsPluginManager.php

示例11: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     // If there is no route name, this is a broken definition.
     if (empty($definition['route_name'])) {
         throw new PluginException(sprintf('Plugin (%s) definition must include "route_name"', $plugin_id));
     }
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:11,代碼來源:LocalTaskManager.php

示例12: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     $this->processDefinitionCategory($definition);
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:8,代碼來源:CategorizingPluginManagerTraitTest.php

示例13: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     if (!isset($definition['list_class'])) {
         $definition['list_class'] = '\\Drupal\\Core\\Field\\FieldItemList';
     }
     // Ensure that every field type has a category.
     if (empty($definition['category'])) {
         $definition['category'] = $this->t('General');
     }
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:14,代碼來源:FieldTypePluginManager.php

示例14: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     if (!isset($definition['base_route_name'])) {
         throw new InvalidPluginDefinitionException($plugin_id, SafeMarkup::format("The plugin definition of the mapper '%plugin_id' does not contain a base_route_name.", array('%plugin_id' => $plugin_id)));
     }
 }
開發者ID:RealLukeMartin,項目名稱:drupal8tester,代碼行數:10,代碼來源:ConfigMapperManager.php

示例15: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     $definition['supported'] = (bool) call_user_func([$definition['class'], 'checkRequirements']);
 }
開發者ID:sgtsaughter,項目名稱:d8portfolio,代碼行數:8,代碼來源:DevelDumperPluginManager.php


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