phpzend-frameworksocialengine

How a table is selected in SocialEngine


I used to think SocialEngine's convention for selecting tables is like this:

Engine_Api::_()->getDbTable('tableName', 'moduleName');

But, logging in the following code segment shows engine4_video_categories, which does not have much to do with the parameters passed to getDbTable():

public function getTable() {
    if (is_null($this->_table)) {
        $this->_table = Engine_Api::_()->getDbtable('videoCategories', 'sitevideo');
    }
    error_log("Video category table: " . $this->_table->info('name'));
    return $this->_table;
}

Would someone clarify how table selection works in SocialEngine.


Solution

  • Engine_Api::_()->getDbTable('filename of created for table in DBTable folder', 'moduleName');