2014-01-30 36 views
0

我嘗試更新我的自定義模型,將兩個新屬性添加到我的模型中。AddAttribute error

我修改了config.xml中文件中添加版本0.0.2和我創建稱爲SQL文件夾的新PHP文件mysql4升級,0.0.1-0.0.2.php

該文件被正確執行,但Magento的生成包含一個通用的錯誤,即報告錯誤「在文件錯誤...

下面你可以找到我的代碼:

<?php 
$installer = $this; 
$installer->startSetup(); 

$installer->addAttribute("configurador/vista", "radiovertical", array(
    "type"  => "dec", 
    "backend" => "", 
    "frontend" => "", 
    "label" => "Radio Vertical", 
    "input" => "text", 
    "class" => "", 
    "source" => "", 
    "global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 
    "visible" => true, 
    "required" => true, 
    "user_defined" => false, 
    "default" => "", 
    "searchable" => false, 
    "filterable" => false, 
    "comparable" => false, 
    "visible_on_front" => false, 
    "unique"  => false, 
    "note"  => "" 
)); 

$installer->addAttribute("configurador/vista", "radiohorizontal", array(
    "type"  => "dec", 
    "backend" => "", 
    "frontend" => "", 
    "label" => "Radio horizontal", 
    "input" => "text", 
    "class" => "", 
    "source" => "", 
    "global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 
    "visible" => true, 
    "required" => true, 
    "user_defined" => false, 
    "default" => "", 
    "searchable" => false, 
    "filterable" => false, 
    "comparable" => false, 
    "visible_on_front" => false, 
    "unique"  => false, 
    "note"  => "" 
)); 
$installer->endSetup(); 

有人可以說我做錯了什麼嗎?

在此先感謝

+0

您的型號是EAV還是flat? – Marius

回答

0

"configurador/vista"或許應該'catalog_product'來代替。 addAttribute()的第一個字段是entity_type_id。該字段的所有可用值可在表eav_entity_type中找到(您可以使用entity_type_id或entity_type_code)

相關問題