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


PHP Mage_Eav_Model_Entity_Setup类代码示例

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


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

示例1: catalogProductPrepareSave

 public function catalogProductPrepareSave($event)
 {
     $productData = $event->getRequest()->getPost('product');
     if ($productData) {
         foreach (Mage::helper('davidjordan_lazyloadingoption')->getAttributeCodes() as $attributeCode) {
             if (empty($productData[$attributeCode])) {
                 $post = $event->getRequest()->getPost();
                 if (!empty($post['product']["{$attributeCode}_visible_input"])) {
                     $label = $post['product']["{$attributeCode}_visible_input"];
                     $attributeModel = Mage::getModel('catalog/resource_eav_attribute')->loadByCode(4, $attributeCode);
                     $foundVal = array_reduce($attributeModel->getSource()->getAllOptions(false), function ($acc, $val) use($label) {
                         return $acc ?: ($val['label'] == $label ? $val['value'] : $acc);
                     }, "");
                     if ($foundVal) {
                         $productData[$attributeCode] = $foundVal;
                     } else {
                         $setup = new Mage_Eav_Model_Entity_Setup('core_write');
                         $setup->addAttributeOption(array('attribute_id' => $attributeModel->getId(), 'values' => array($label)));
                         $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
                         $optionValueId = $connection->lastInsertId();
                         $optionId = $connection->fetchOne("SELECT option_id FROM " . $setup->getTable('eav/attribute_option_value') . " WHERE value_id = ?", $optionValueId);
                         $productData[$attributeCode] = $optionId;
                     }
                     $event->getProduct()->setData($attributeCode, $productData[$attributeCode]);
                 } elseif ($origData = $event->getProduct()->getOrigData($attributeCode)) {
                     $event->getProduct()->setData($attributeCode, $origData);
                 }
             }
         }
     }
 }
开发者ID:suspiciousfellow,项目名称:Lazyloadingoption,代码行数:31,代码来源:Observer.php

示例2: _addAttributeToAttributeSet

 protected function _addAttributeToAttributeSet($attributeSetId, $attributeCode)
 {
     $setup = new \Mage_Eav_Model_Entity_Setup('core_setup');
     $attributeId = $setup->getAttributeId('catalog_product', $attributeCode);
     $attributeGroupId = $setup->getDefaultAttributeGroupId('catalog_product', $attributeSetId);
     $setup->addAttributeToSet('catalog_product', $attributeSetId, $attributeGroupId, $attributeId);
 }
开发者ID:eniuz,项目名称:EAVCleaner,代码行数:7,代码来源:MessdataCommand.php

示例3: createAttribute

 public function createAttribute($object)
 {
     $attributeId = Mage::getModel('eav/entity_attribute')->getIdByCode('catalog_product', $object['attribute_code']);
     if ($attributeId) {
         Mage::getModel('eav/entity_attribute')->load($attributeId)->delete();
     }
     $model = Mage::getModel('catalog/resource_eav_attribute');
     $data = array('attribute_code' => $object['attribute_code'], 'attribute_model' => $object['attribute_model'], 'backend_model' => $object['backend_model'], 'backend_type' => $object['backend_type'], 'backend_table' => $object['backend_table'], 'frontend_model' => $object['frontend_model'], 'frontend_input' => $object['frontend_input'], 'frontend_label' => $object['frontend_label'], 'frontend_class' => $object['frontend_class'], 'source_model' => $object['source_model'], 'is_required' => $object['is_required'], 'is_user_defined' => $object['is_user_defined'], 'default_value' => $object['default_value'], 'is_unique' => $object['is_unique'], 'note' => $object['note'], 'frontend_input_renderer' => $object['frontend_input_renderer'], 'is_global' => $object['is_global'], 'is_visible' => $object['is_visible'], 'is_searchable' => $object['is_searchable'], 'is_filterable' => $object['is_filterable'], 'is_comparable' => $object['is_comparable'], 'is_visible_on_front' => $object['is_visible_on_front'], 'is_html_allowed_on_front' => $object['is_html_allowed_on_front'], 'is_used_for_price_rules' => $object['is_used_for_price_rules'], 'is_filterable_in_search' => $object['is_filterable_in_search'], 'used_in_product_listing' => $object['used_in_product_listing'], 'used_for_sort_by' => $object['used_for_sort_by'], 'is_configurable' => $object['is_configurable'], 'apply_to' => $object['apply_to'], 'is_visible_in_advanced_search' => $object['is_visible_in_advanced_search'], 'position' => $object['position'], 'is_wysiwyg_enabled' => $object['is_wysiwyg_enabled'], 'is_used_for_promo_rules' => $object['is_used_for_promo_rules']);
     $model->addData($data);
     $model->setEntityTypeId($this->typeId);
     try {
         $model->save();
         echo $model->getAttributeCode() . " ..........................ok. ID: " . $model->getId() . "\n";
         $model->setSourceModel($object['source_model']);
         // TODO: check why need it, and how fix it for right set source_model
         $model->save();
     } catch (Exception $ex) {
         echo "Error: " . $ex->getMessage() . "\n";
     }
     //add attribute options
     if (empty($object['options'])) {
         echo "Model " . $model->getAttributeCode() . " saved ..........................ok. \n";
         return;
     }
     $option['attribute_id'] = $model->getId();
     foreach ($object['options'] as $opt) {
         $option['value']['option'][0] = $opt;
         //mage::d($option); //die;
         $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
         $setup->addAttributeOption($option);
     }
     echo "Model " . $model->getAttributeCode() . " saved. options added ..........................ok. \n";
 }
开发者ID:CherylMuniz,项目名称:fashion,代码行数:33,代码来源:lensattrs_a.php

示例4: _prepareCollection

 /**
  * prepare collection for block to display
  *
  * @return Magestore_Customerattribute_Block_Adminhtml_Customerattribute_Grid
  */
 protected function _prepareCollection()
 {
     $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
     $entityTypeId = $setup->getEntityTypeId('customer');
     $tbl_faq_item = Mage::getSingleton('core/resource')->getTableName('customerattribute/customerattribute');
     $collection = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($entityTypeId);
     $collection->getSelect()->join(array('table_attribute' => $tbl_faq_item), 'main_table.attribute_id=table_attribute.attribute_id');
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:15,代码来源:Grid.php

示例5: addoptions

 /**
  * Create attribute options
  *
  * @param string $attributeId
  * @param array $attributeOptions
  * @return int
  */
 public function addoptions($attributeId, $attributeOptions)
 {
     $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
     foreach ($attributeOptions as $label) {
         $option = array();
         $option['attribute_id'] = $attributeId;
         $option['value'] = array(array(0 => $label));
         $setup->addAttributeOption($option);
     }
     return true;
 }
开发者ID:adrianoaguiar,项目名称:magja-catalog-ext,代码行数:18,代码来源:Api.php

示例6: deletarAtributo

 public function deletarAtributo($id_opcao)
 {
     $attribute_code = Mage::getStoreConfig('cores/config/codigo_cor');
     $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', $attribute_code);
     $options = $attribute->getSource()->getAllOptions();
     $option_id = $id_opcao;
     $options['delete'][$option_id] = true;
     $options['value'][$option_id] = true;
     $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
     $setup->addAttributeOption($options);
 }
开发者ID:xiaoguizhidao,项目名称:emporiodopara,代码行数:11,代码来源:Cores.php

示例7: getAttributeList

 public function getAttributeList()
 {
     if (!self::$_attributes) {
         $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
         $attrs = Vikont_Data2data_Helper_Db::getTableValues('eav/attribute', array('attribute_id', 'attribute_code'), array('entity_type_id=' . self::getEntityTypeId()));
         foreach ($attrs as $attr) {
             $data = $setup->getAttribute(self::getEntityTypeId(), $attr['attribute_id']);
             self::$_attributes[$attr['attribute_code']] = array('backend' => $data['backend_model'], 'type' => $data['backend_type'], 'table' => $data['backend_table'], 'frontend' => $data['frontend_model'], 'input' => $data['frontend_input'], 'label' => $data['frontend_label'], 'frontend_class' => $data['frontend_class'], 'source' => $data['source_model'], 'required' => $data['is_required'], 'user_defined' => $data['is_user_defined'], 'default' => $data['default_value'], 'unique' => $data['is_unique'], 'note' => $data['note'], 'global' => $data['is_global']);
         }
     }
     return self::$_attributes;
 }
开发者ID:rcclaudrey,项目名称:dev,代码行数:12,代码来源:Category.php

示例8: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('real_order_id', array('header' => Mage::helper('sales')->__('Order #'), 'width' => '80px', 'type' => 'text', 'index' => 'increment_id'));
     if (!Mage::app()->isSingleStoreMode()) {
         $this->addColumn('store_id', array('header' => Mage::helper('sales')->__('Purchased From (Store)'), 'index' => 'store_id', 'type' => 'store', 'store_view' => true, 'display_deleted' => true));
     }
     $this->addColumn('created_at', array('header' => Mage::helper('sales')->__('Purchased On'), 'index' => 'created_at', 'type' => 'datetime', 'width' => '100px'));
     $this->addColumn('billing_name', array('header' => Mage::helper('sales')->__('Bill to Name'), 'index' => 'billing_name'));
     $this->addColumn('shipping_name', array('header' => Mage::helper('sales')->__('Ship to Name'), 'index' => 'shipping_name'));
     //  Add Column Customer Attribute to Order grid create by Hoatq
     $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
     $entityTypeId = $setup->getEntityTypeId('customer');
     $tbl_faq_item = Mage::getSingleton('core/resource')->getTableName('customerattribute/customerattribute');
     $models = Mage::getModel('customer/attribute')->getCollection();
     $models->getSelect()->join(array('table_attribute' => $tbl_faq_item), 'main_table.attribute_id=table_attribute.attribute_id');
     //->addFieldToFilter('main_table.attribute_id',$customerattributeId);
     $models->addFieldToFilter('show_on_grid_order', 1);
     $i = 0;
     if ($i == 0) {
         foreach ($models as $model) {
             $index = 'customer_' . $model->getAttributeCode();
             $frontend_input = $model->getFrontendInput();
             if ($frontend_input != 'file' && $frontend_input != 'image') {
                 if ($frontend_input == 'boolean') {
                     $this->addColumn($index, array('header' => Mage::helper('sales')->__('Customer ' . str_replace('_', ' ', $model->getAttributeCode())), 'index' => $index, 'align' => 'center', 'type' => 'options', 'options' => array(0 => 'No', 1 => 'Yes')));
                 } elseif ($frontend_input == 'multiselect') {
                     $this->addColumn($index, array('header' => Mage::helper('sales')->__('Customer ' . str_replace('_', ' ', $model->getAttributeCode())), 'index' => $index, 'align' => 'center', 'type' => 'options', 'options' => Mage::helper('customerattribute')->getOptions($show['attribute_id']), 'renderer' => 'Magestore_Customerattribute_Block_Adminhtml_Sales_Order_Renderer_Multiselect', 'filter' => false));
                 } elseif ($frontend_input == 'select') {
                     $this->addColumn($index, array('header' => Mage::helper('sales')->__('Customer ' . str_replace('_', ' ', $model->getAttributeCode())), 'index' => $index, 'type' => 'options', 'options' => Mage::helper('customerattribute')->getOptions($model->getId())));
                 } elseif ($frontend_input == 'date') {
                     $this->addColumn($index, array('header' => Mage::helper('sales')->__('Customer ' . str_replace('_', ' ', $model->getAttributeCode())), 'index' => $index, 'type' => 'date', 'format' => Mage::helper('customerattribute')->getDateFormat1(), 'filter' => false));
                 } else {
                     $this->addColumn($index, array('header' => Mage::helper('sales')->__('Customer ' . str_replace('_', ' ', $model->getAttributeCode())), 'index' => $index));
                 }
             }
         }
         $i++;
     }
     // -----------------------------------
     $this->addColumn('base_grand_total', array('header' => Mage::helper('sales')->__('G.T. (Base)'), 'index' => 'base_grand_total', 'type' => 'currency', 'currency' => 'base_currency_code'));
     $this->addColumn('grand_total', array('header' => Mage::helper('sales')->__('G.T. (Purchased)'), 'index' => 'grand_total', 'type' => 'currency', 'currency' => 'order_currency_code'));
     $this->addColumn('status', array('header' => Mage::helper('sales')->__('Status'), 'index' => 'status', 'type' => 'options', 'width' => '70px', 'options' => Mage::getSingleton('sales/order_config')->getStatuses()));
     if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
         $this->addColumn('action', array('header' => Mage::helper('sales')->__('Action'), 'width' => '50px', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => Mage::helper('sales')->__('View'), 'url' => array('base' => '*/sales_order/view'), 'field' => 'order_id')), 'filter' => false, 'sortable' => false, 'index' => 'stores', 'is_system' => true));
     }
     $this->addRssList('rss/order/new', Mage::helper('sales')->__('New Order RSS'));
     $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
     $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));
     return $this;
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:50,代码来源:Grid.php

示例9: _prepareColumns

 protected function _prepareColumns()
 {
     $i = 0;
     $this->addColumn('entity_id', array('header' => Mage::helper('customerattribute')->__('ID'), 'align' => 'right', 'width' => '50px', 'index' => 'entity_id'));
     $this->addColumn('name', array('header' => Mage::helper('customerattribute')->__('Name'), 'align' => 'left', 'width' => '150px', 'index' => 'name'));
     $this->addColumn('email', array('header' => Mage::helper('customerattribute')->__('Email'), 'align' => 'left', 'width' => '150px', 'index' => 'email'));
     $groups = Mage::getResourceModel('customer/group_collection')->addFieldToFilter('customer_group_id', array('gt' => 0))->load()->toOptionHash();
     $this->addColumn('group', array('header' => Mage::helper('customerattribute')->__('Group'), 'width' => '100', 'index' => 'group_id', 'type' => 'options', 'options' => $groups));
     if ($i == 0) {
         $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
         $entityTypeId = $setup->getEntityTypeId('customer');
         $tbl_faq_item = Mage::getSingleton('core/resource')->getTableName('customerattribute/customerattribute');
         $shows = Mage::getModel('customer/attribute')->getCollection();
         $shows->getSelect()->join(array('table_attribute' => $tbl_faq_item), 'main_table.attribute_id=table_attribute.attribute_id')->order('sort_order ASC');
         //->addFieldToFilter('main_table.attribute_id',$customerattributeId);
         $shows->addFieldToFilter('show_on_grid_customer', 1);
         foreach ($shows as $show) {
             if ($show['frontend_input'] == 'select') {
                 $this->addColumn($show['attribute_code'], array('header' => Mage::helper('customerattribute')->__($show['frontend_label']), 'align' => 'left', 'type' => 'options', 'options' => Mage::helper('customerattribute')->getOptions($show['attribute_id']), 'index' => $show['attribute_code']));
             } else {
                 if ($show['frontend_input'] == 'multiselect') {
                     $this->addColumn($show['attribute_code'], array('header' => Mage::helper('customerattribute')->__($show['frontend_label']), 'align' => 'left', 'type' => 'options', 'options' => Mage::helper('customerattribute')->getOptions($show['attribute_id']), 'index' => $show['attribute_code'], 'renderer' => 'Magestore_Customerattribute_Block_Adminhtml_Managecustomer_Renderer_Multiselect', 'filter_condition_callback' => array($this, '_multiSelectFilter')));
                 } else {
                     if ($show['frontend_input'] == 'image') {
                         $this->addColumn($show['attribute_code'], array('header' => Mage::helper('customerattribute')->__($show['frontend_label']), 'align' => 'center', 'type' => 'image', 'width' => 60, 'index' => $show['attribute_code'], 'renderer' => 'Magestore_Customerattribute_Block_Adminhtml_Managecustomer_Renderer_Image', 'filter' => false));
                     } else {
                         if ($show['frontend_input'] == 'boolean') {
                             $this->addColumn($show['attribute_code'], array('header' => Mage::helper('customerattribute')->__($show['frontend_label']), 'align' => 'left', 'type' => 'options', 'options' => array(0 => 'No', 1 => 'Yes'), 'index' => $show['attribute_code']));
                         } else {
                             if ($show['frontend_input'] == 'file') {
                                 $this->addColumn($show['attribute_code'], array('header' => Mage::helper('customerattribute')->__($show['frontend_label']), 'align' => 'left', 'type' => 'image', 'index' => $show['attribute_code'], 'renderer' => 'Magestore_Customerattribute_Block_Adminhtml_Managecustomer_Renderer_File', 'filter' => false));
                             } else {
                                 if ($show['frontend_input'] == 'date') {
                                     $this->addColumn($show['attribute_code'], array('header' => Mage::helper('customerattribute')->__($show['frontend_label']), 'align' => 'left', 'type' => 'datetime', 'gmtoffset' => true, 'index' => $show['attribute_code'], 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM)));
                                 } else {
                                     $this->addColumn($show['attribute_code'], array('header' => Mage::helper('customerattribute')->__($show['frontend_label']), 'align' => 'left', 'type' => $show['frontend_input'], 'index' => $show['attribute_code']));
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $i++;
     }
     $this->addColumn('action', array('header' => Mage::helper('customerattribute')->__('Action'), 'width' => '100px', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => Mage::helper('customerattribute')->__('Edit'), 'url' => array('base' => 'adminhtml/customer/edit'), 'field' => 'id')), 'filter' => false, 'sortable' => false, 'index' => 'stores', 'is_system' => true));
     $this->addExportType('*/*/exportCsv', Mage::helper('customerattribute')->__('CSV'));
     $this->addExportType('*/*/exportXml', Mage::helper('customerattribute')->__('XML'));
     return parent::_prepareColumns();
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:50,代码来源:Grid.php

示例10: getAttributeLabel

 public function getAttributeLabel($data)
 {
     $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
     $entityTypeId = $setup->getEntityTypeId('customer');
     $tbl_faq_item = Mage::getSingleton('core/resource')->getTableName('customerattribute/customerattribute');
     $customerAttribute = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($entityTypeId);
     $customerAttribute->getSelect()->join(array('table_attribute' => $tbl_faq_item), 'main_table.attribute_id=table_attribute.attribute_id');
     $customerAttribute->addFieldToFilter('table_attribute.is_custom', 1);
     $customerAttribute->addFieldToFilter('frontend_input', 'date');
     foreach ($customerAttribute as $a) {
         $data = $this->_filterDates($data, array($a->getAttributeCode(), 'valid_to'));
     }
     return $data;
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:14,代码来源:Data.php

示例11: addAttributeGroup

 /**
  * Add Attribute Group
  *
  * @param mixed $entityTypeId
  * @param mixed $setId
  * @param string $name
  * @param int $sortOrder
  * @return integer The ID of the last created attribute group
  * @see Mage_Eav_Model_Entity_Setup::addAttributeGroup($entityTypeId, $setId, $name, $sortOrder=null)
  */
 public function addAttributeGroup($entityTypeId, $setId, $name, $sortOrder = null)
 {
     // add the attribute group
     Mage_Eav_Model_Entity_Setup::addAttributeGroup($entityTypeId, $setId, $name, $sortOrder);
     // load the ID of the last created attribute group
     return $this->_conn->lastInsertId();
 }
开发者ID:BGCX067,项目名称:faett-package-svn-to-git,代码行数:17,代码来源:Setup.php

示例12: getCustomtabInfo

 public function getCustomtabInfo($tab)
 {
     $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
     $entityTypeId = $setup->getEntityTypeId('customer');
     //$storeId=$this->getCustomerAttribute()->getStoreId();
     //$group=$this->getCustomerAttribute()->getGroupId();
     $tbl_faq_item = Mage::getSingleton('core/resource')->getTableName('customerattribute/customerattribute');
     $customerAttribute = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($entityTypeId);
     $customerAttribute->getSelect()->join(array('table_attribute' => $tbl_faq_item), 'main_table.attribute_id=table_attribute.attribute_id');
     $customerAttribute->addFieldToFilter('table_attribute.is_custom', 1);
     $customerAttribute->addFieldToFilter('table_attribute.custom_tab', $tab);
     //if($storeId!=0)
     //$customerAttribute->addFieldToFilter('table_attribute.store_id',array('like'=>'%'.$storeId.'%'));
     //$customerAttribute->addFieldToFilter('table_attribute.customer_group',array("like"=>'%'.$group.'%'));
     return $customerAttribute;
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:16,代码来源:Form.php

示例13: editAction

 /**
  * view and edit item action
  */
 public function editAction()
 {
     $attributeId = $this->getRequest()->getParam('id');
     $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
     $entityTypeId = $setup->getEntityTypeId('customer_address');
     $tbl_faq_item = Mage::getSingleton('core/resource')->getTableName('customerattribute/customeraddressattribute');
     $models = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($entityTypeId);
     $models->getSelect()->join(array('table_attribute' => $tbl_faq_item), 'main_table.attribute_id=table_attribute.attribute_id');
     $models->addFieldToFilter('main_table.attribute_id', $attributeId);
     $model = $models->getFirstItem();
     // register attribute object
     Mage::register('customeraddressattribute_data', $model);
     $this->loadLayout();
     $this->_setActiveMenu('customer/customerattribute/customeraddressattribute');
     $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
     $this->_addContent($this->getLayout()->createBlock('customerattribute/adminhtml_customeraddressattribute_edit'))->_addLeft($this->getLayout()->createBlock('customerattribute/adminhtml_customeraddressattribute_edit_tabs'));
     $this->renderLayout();
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:21,代码来源:CustomeraddressattributeController.php

示例14: execute

 /**
  * @param InputInterface   $input
  * @param OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->detectMagento($output, true);
     if ($this->initMagento()) {
         $entityType = $input->getArgument('entityType');
         try {
             $attributes = \Mage::getModel('eav/config')->getEntityAttributeCodes($entityType);
         } catch (\Mage_Core_Exception $e) {
             throw new \InvalidArgumentException($e->getMessage());
         }
         $setup = new \Mage_Eav_Model_Entity_Setup('core_setup');
         foreach ($input->getArgument('attributeCode') as $attributeCode) {
             if (!in_array($attributeCode, $attributes)) {
                 $message = sprintf('Attribute: "%s" does not exist for entity type: "%s"', $attributeCode, $entityType);
                 $output->writeln(sprintf('<comment>%s</comment>', $message));
             } else {
                 $setup->removeAttribute($entityType, $attributeCode);
                 $output->writeln(sprintf('<info>Successfully removed attribute: "%s" from entity type: "%s"</info>', $attributeCode, $entityType));
             }
         }
     }
 }
开发者ID:aedmonds,项目名称:n98-magerun,代码行数:26,代码来源:RemoveCommand.php

示例15: Mage_Eav_Model_Entity_Setup

 * This file is part of the Itabs_Debit module.
 *
 * PHP version 5
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * @category  Itabs
 * @package   Itabs_Debit
 * @author    ITABS GmbH <info@itabs.de>
 * @copyright 2008-2014 ITABS GmbH (http://www.itabs.de)
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @version   1.1.6
 * @link      http://www.magentocommerce.com/magento-connect/debitpayment.html
 */
/**
 * Setup script
 */
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->updateAttribute('customer', 'debit_payment_acount_update', 'frontend_input', 'date');
$installer->endSetup();
开发者ID:dedlich,项目名称:Magento-DebitPayment,代码行数:31,代码来源:mysql4-upgrade-0.5.0-0.5.1.php


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