How to set table prefix with Zend_Db_Table
1
2
| /* bootstrap file */
define('_TABLE_PREFIX', $config->db->table->prefix); |
1
2
3
4
56
7
8
9
1011
12
13
14
| 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;
}
}
} |
Comments
You must login before commenting on a snippet. If you do not have an account,
please register.
Snippet description
Snippet details
- Created:
-
Pacek
1 year ago
- Edited:
-
Pacek
1 year ago
- Revision Id:
- 13
- Edit Message:
- Initial Release
- Tags:
- zend_db
Zend_Db_Table
table prefix
- Comments:
- 3
- Views:
- 196
- Points:
- 0 (0 votes)
History
1 year ago
very nice
Thanks