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


PHP UiComponentInterface::getData方法代碼示例

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


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

示例1: getJsConfig

 /**
  * Get JS config
  *
  * @return array
  */
 public function getJsConfig()
 {
     if (isset($this->wrappedComponent)) {
         return array_replace_recursive((array) $this->wrappedComponent->getData('config'), (array) $this->getData('config'));
     }
     return (array) $this->getData('config');
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:12,代碼來源:Column.php

示例2: prepare

 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     $dataType = $this->getData('config/dataType');
     if ($dataType) {
         $this->wrappedComponent = $this->uiComponentFactory->create($this->getName(), $dataType, array_merge(['context' => $this->getContext()], (array) $this->getData()));
         $this->wrappedComponent->prepare();
         $wrappedComponentConfig = $this->getJsConfig($this->wrappedComponent);
         // Merge JS configuration with wrapped component configuration
         $jsConfig = array_replace_recursive($wrappedComponentConfig, $this->getJsConfig($this));
         $this->setData('js_config', $jsConfig);
         $this->setData('config', array_replace_recursive((array) $this->wrappedComponent->getData('config'), (array) $this->getData('config')));
     }
     $this->applySorting();
     parent::prepare();
 }
開發者ID:niranjanssiet,項目名稱:magento2,代碼行數:20,代碼來源:Column.php

示例3: prepare

 /**
  * Prepare component configuration
  *
  * @return void
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function prepare()
 {
     $formElement = $this->getData('config/formElement');
     if (null === $formElement) {
         throw new LocalizedException(__('The configuration parameter "formElement" is a required for "' . $this->getName() . '" field.'));
     }
     // Create of wrapped component
     $this->wrappedComponent = $this->uiComponentFactory->create($this->getName(), $formElement, array_merge(['context' => $this->getContext()], (array) $this->getData()));
     $this->wrappedComponent->prepare();
     // Merge JS configuration with wrapped component configuration
     $wrappedComponentConfig = $this->getJsConfig($this->wrappedComponent);
     $jsConfig = array_replace_recursive($wrappedComponentConfig, $this->getJsConfig($this));
     $jsConfig['extends'] = $this->wrappedComponent->getComponentName();
     $this->setData('js_config', $jsConfig);
     $this->setData('config', array_replace_recursive((array) $this->wrappedComponent->getData('config'), (array) $this->getData('config')));
     parent::prepare();
 }
開發者ID:kid17,項目名稱:magento2,代碼行數:23,代碼來源:Field.php

示例4: generate

 /**
  * Build component structure and retrieve
  *
  * @param UiComponentInterface $component
  * @return array
  */
 public function generate(UiComponentInterface $component)
 {
     /** @var LayoutInterface $layout */
     if (!($layoutDefinition = $component->getData('layout'))) {
         $layoutDefinition = ['type' => 'generic'];
     }
     $layout = $this->layoutPool->create($layoutDefinition['type'], $layoutDefinition);
     return $layout->build($component);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:15,代碼來源:Structure.php

示例5: update

 /**
  * @inheritDoc
  */
 public function update(UiComponentInterface $component)
 {
     if ($component instanceof ColumnInterface) {
         $filterType = $component->getData('config/filter');
         if (is_array($filterType)) {
             $filterType = $filterType['filterType'];
         }
         if (!$filterType) {
             return;
         }
         if (isset($this->filterMap[$filterType])) {
             $filterComponent = $this->uiComponentFactory->create($component->getName(), $this->filterMap[$filterType], ['context' => $this->getContext()]);
             $filterComponent->setData('config', $component->getConfiguration());
             $filterComponent->prepare();
             $this->addComponent($component->getName(), $filterComponent);
         }
     }
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:21,代碼來源:Filters.php

示例6: updateComponent

 /**
  * Update component data
  *
  * @param array $componentData
  * @param UiComponentInterface $component
  * @return $this
  */
 protected function updateComponent(array $componentData, UiComponentInterface $component)
 {
     $config = $component->getData('config');
     // XML data configuration override configuration coming from the DB
     $config = array_replace_recursive($componentData, $config);
     $component->setData('config', $config);
     return $this;
 }
開發者ID:hientruong90,項目名稱:magento2_installer,代碼行數:15,代碼來源:AbstractComponent.php

示例7: updateField

 /**
  * Update field data
  *
  * @param array $fieldData
  * @param UiComponentInterface $component
  * @return void
  */
 protected function updateField(array $fieldData, UiComponentInterface $component)
 {
     $config = $component->getData('config');
     // XML data configuration override configuration coming from the DB
     $config = array_replace_recursive($fieldData, $config);
     $config = $this->updateDataScope($config, $component->getName());
     $component->setData('config', $config);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:15,代碼來源:Fieldset.php

示例8: getJsConfig

 /**
  * Get configuration of related JavaScript Component
  * (force extending the root component if component does not extend other component)
  *
  * @param UiComponentInterface $component
  * @return array
  */
 public function getJsConfig(UiComponentInterface $component)
 {
     $jsConfig = (array) $component->getData('js_config');
     if (!isset($jsConfig['extends'])) {
         $jsConfig['extends'] = $component->getContext()->getNamespace();
     }
     return $jsConfig;
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:15,代碼來源:AbstractComponent.php

示例9: getConfiguration

 /**
  * Get JS configuration
  *
  * @param UiComponentInterface $component
  * @param null|string $extends
  * @return array
  */
 protected function getConfiguration(UiComponentInterface $component, $extends = null)
 {
     $jsConfig = (array) $component->getData('js_config');
     if (isset($jsConfig['extends'])) {
         return $jsConfig;
     } else {
         if (null !== $extends) {
             $jsConfig['extends'] = $extends;
         } else {
             $jsConfig['extends'] = $component->getContext()->getNamespace();
         }
     }
     return $jsConfig;
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:21,代碼來源:AbstractComponent.php

示例10: initSections

 /**
  * Prepare initial structure for sections
  *
  * @return void
  */
 protected function initSections()
 {
     $this->structure[static::SECTIONS_KEY] = ['type' => 'nav', 'config' => ['label' => $this->component->getData('label')], 'children' => []];
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:9,代碼來源:Tabs.php

示例11: addOptions

 /**
  * Add options to component
  *
  * @param UiComponentInterface $component
  * @param array $attributeData
  * @return void
  */
 public function addOptions(UiComponentInterface $component, array $attributeData)
 {
     $config = $component->getData('config');
     if (count($attributeData[AttributeMetadata::OPTIONS]) && !isset($config[AttributeMetadata::OPTIONS])) {
         $component->setData('config', array_merge($config, [AttributeMetadata::OPTIONS => $attributeData[AttributeMetadata::OPTIONS]]));
     }
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:14,代碼來源:Columns.php

示例12: execute

 /**
  * Execute directive
  *
  * @param array $directive
  * @param UiComponentInterface $component
  * @return string
  */
 public function execute($directive, UiComponentInterface $component)
 {
     return $component->getData($directive[1]);
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:11,代碼來源:Variable.php


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