An alternative to deprecated addKey() method in Magento? -


i trying add index column on magento data setup script.

/** @var mage_eav_model_entity_setup $installer */ $installer = $this; $installer->startsetup(); $installer     ->getconnection()     ->addkey(         $installer->gettable('enterprise_rma/rma'),         'idx_export_date',         'export_date'     ); 

however our inspection tool complains:

the method varien_db_adapter_pdo_mysql::addkey() has been deprecated message: since 1.5.0.0 

what can use instead of addkey() in case?

look @ addkey function in class varien_db_adapter_pdo_mysql:

public function addkey($tablename, $indexname, $fields, $indextype = 'index', $schemaname = null) {     return $this->addindex($tablename, $indexname, $fields, $indextype, $schemaname); } 

it making call addindex function of same class, function not deprecated, should use one.

/**  * add new index table name  *  * @param string $tablename  * @param string $indexname  * @param string|array $fields  table column name or array of ones  * @param string $indextype     index type  * @param string $schemaname  * @return zend_db_statement_interface  * @throws zend_db_exception|exception  */ public function addindex($tablename, $indexname, $fields,     $indextype = varien_db_adapter_interface::index_type_index, $schemaname = null) 

(my code come magento enterprise 1.12)


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -