Magento 预加载我的实体的属性

Magento 预加载我的实体的属性,magento,Magento,伙计们 如何预加载某个实体的eav属性?比如: 想要以编程方式预加载客户的属性吗?还是以编程方式编辑我的产品目录?您所说的“预加载”是什么意思? 只需调用loadByCode即可轻松加载任何属性: $attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', '%attribute_code%') 或者,可以使用集合加载所有属性: $entityType = Mage

伙计们

如何预加载某个实体的eav属性?比如:


想要以编程方式预加载客户的属性吗?还是以编程方式编辑我的产品目录?

您所说的“预加载”是什么意思? 只需调用loadByCode即可轻松加载任何属性:

$attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', '%attribute_code%')
或者,可以使用集合加载所有属性:

$entityType          = Mage::getModel('eav/entity_type')->loadByCode('catalog_product');
$attributeCollection = Mage::getModel('eav/entity_attribute')->getCollection()->setEntityTypeFilter($entityType);
magento中有8种实体类型:

  • 顾客
  • 客户地址
  • 目录类别
  • 产品目录
  • 命令
  • 发票
  • 信用备忘录
  • 装运

  • 有几个实体类型比这个多-ref
    eav\u entity\u type
    table。