Skip to content

Instantly share code, notes, and snippets.

@miholeus
Created December 17, 2010 23:53
Show Gist options
  • Save miholeus/745929 to your computer and use it in GitHub Desktop.
Save miholeus/745929 to your computer and use it in GitHub Desktop.
table prefix snippet in ZF
/* 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