Created
December 17, 2010 23:53
-
-
Save miholeus/745929 to your computer and use it in GitHub Desktop.
table prefix snippet in ZF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* bootstrap file */ | |
define('_TABLE_PREFIX', $config->db->table->prefix); | |
class Extend_Db_Table extends Zend_Db_Table_Abstract | |
{ | |
/** | |
* This will automatically set table name with prefix from bootstrap file | |
* @return void | |
*/ | |
protected function _setupTableName() | |
{ | |
parent::_setupTableName(); | |
if(defined('_TABLE_PREFIX')) { | |
$this->_name = _TABLE_PREFIX . $this->_name; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment