本文整理汇总了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';
}
}
示例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();
}