我試圖讓這段代碼的attribute_set_id:getAttributeSetId()老是報錯
$SetId = Mage::getModel('eav/entity_setup')
->getAttributeSetId('catalog_product','Default');
不過,我總是得到這樣的錯誤:
Call to a member function select() on a non-object in
magento\app\code\core\Mage\Core\Model\Resource\Setup.php on line 734
這是Setup.php行734:
$select = $adapter->select()
->from($table)
->where($adapter->quoteIdentifier($idField) . '= :id_field');
我所知道的Mage_Eav_Model_Entity_Setup類已經擴展Mage_Core_Model_Resource_Setup類。爲什麼它仍然說非對象?
謝謝。
你確定適配器是一個對象呢? PHP告訴你這不是 – Soundz