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


PHP Mage_ImportExport_Model_Import::getUniqueEntityBehaviors方法代码示例

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


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

示例1: setUpBeforeClass

 /**
  * Add behaviour fieldsets to expected fieldsets
  *
  * @static
  */
 public static function setUpBeforeClass()
 {
     $uniqueBehaviors = Mage_ImportExport_Model_Import::getUniqueEntityBehaviors();
     foreach (array_keys($uniqueBehaviors) as $behavior) {
         self::$_expectedFieldsets[] = $behavior . '_fieldset';
     }
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:12,代码来源:Form.php

示例2: _prepareForm

 /**
  * Add fieldsets
  *
  * @return Mage_ImportExport_Block_Adminhtml_Import_Edit_Form
  */
 protected function _prepareForm()
 {
     $helper = Mage::helper('Mage_ImportExport_Helper_Data');
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/validate'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
     // base fieldset
     /** @var $importEntity Mage_ImportExport_Model_Source_Import_Entity */
     $importEntity = Mage::getModel('Mage_ImportExport_Model_Source_Import_Entity');
     $fieldsets['base'] = $form->addFieldset('base_fieldset', array('legend' => $helper->__('Import Settings')));
     $fieldsets['base']->addField('entity', 'select', array('name' => 'entity', 'title' => $helper->__('Entity Type'), 'label' => $helper->__('Entity Type'), 'required' => true, 'onchange' => 'varienImport.handleEntityTypeSelector();', 'values' => $importEntity->toOptionArray()));
     // add behaviour fieldsets
     $uniqueBehaviors = Mage_ImportExport_Model_Import::getUniqueEntityBehaviors();
     foreach ($uniqueBehaviors as $behaviorCode => $behaviorClass) {
         $fieldsets[$behaviorCode] = $form->addFieldset($behaviorCode . '_fieldset', array('legend' => $helper->__('Import Behavior'), 'style' => 'display:none'));
         /** @var $behaviorSource Mage_ImportExport_Model_Source_Import_BehaviorAbstract */
         $behaviorSource = Mage::getModel($behaviorClass);
         $fieldsets[$behaviorCode]->addField($behaviorCode, 'select', array('name' => 'behavior', 'title' => $helper->__('Import Behavior'), 'label' => $helper->__('Import Behavior'), 'required' => true, 'disabled' => true, 'values' => $behaviorSource->toOptionArray()));
     }
     // fieldset for file uploading
     $fieldsets['upload'] = $form->addFieldset('upload_file_fieldset', array('legend' => $helper->__('File to Import'), 'style' => 'display:none'));
     $fieldsets['upload']->addField(Mage_ImportExport_Model_Import::FIELD_NAME_SOURCE_FILE, 'file', array('name' => Mage_ImportExport_Model_Import::FIELD_NAME_SOURCE_FILE, 'label' => $helper->__('Select File to Import'), 'title' => $helper->__('Select File to Import'), 'required' => true));
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:natxetee,项目名称:magento2,代码行数:29,代码来源:Form.php


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