Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-10-2008, 02:19 PM
Junior Member
 
Join Date: Mar 2008
Posts: 1
Default Zend_Db_Table_Abstract + prefixed tables + magic

Hello, I have a question about using magic table methods with prefixed rables.

The problem is setting the table name.

This:
PHP Code:
protected $_name 'table_name'
won't work because the prefix is variable.

When creating an object this works:

PHP Code:
new Bugs(array('name' => 'bug_db.bugs'); 
but magic methods don't work with that (they don't know about the object you've made).

The only thing that works for me is this:

PHP Code:
protected function _setupTableName()
    {
        global 
$prefix// maybe use zend repository instead
        
$this->_name $prefix.'tablenames';
        
parent::_setupTableName();
    } 
Am I missing something? Does it have to be so complicated? Most real applications use prefixed table names.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:08 AM.