1

Followed Alan Storm's tutorial, and I got some problem while calling createEntityTables() method. My script is like:

$installer->createEntityTables(
    $this->getTable('complexworld/eavblogpost')
);

I've solved the problem related to BLOB/TEXT Mysql error, but another problem occurred. The tables I created have double prefix ("mgt_" is the prefix),

mgt_mgt_eavblog_posts
mgt_mgt_eavblog_posts_char
mgt_mgt_eavblog_posts_datetime
mgt_mgt_eavblog_posts_decimal
mgt_mgt_eavblog_posts_int
mgt_mgt_eavblog_posts_text
mgt_mgt_eavblog_posts_varchar

Tried to dig in createEntityTables() method, and while I print $this->getTable($baseTableName),

if (!$isNoCreateMainTable) {
        /**
         * Create table main eav table
         */
        echo $this->getTable($baseTableName);
        exit;
        $connection = $this->getConnection();

I got "mgt_mgt_eavblog_posts" on the screen, which means the core method may have added an extra prefix to the table name. Any idea what's going wrong here? I appreciate all your kind helps!

4

1 回答 1

5

$table = strtolower(substr(ltrim($this->getTable('complexworld/eavblogpost')), strlen(Mage::getConfig()->getTablePrefix())));

$installer->createEntityTables($table);

于 2013-08-26T13:04:39.950 回答