0
votes

I need to automatically create tables with same structure each month and use a newest one but old tables should be readable. I think to make a table witch will contain names of this tables but how can I use in Zend_Db_Table_Abstract protected $_name of table that I need? I think to make something like

<?php 
class Application_Model_DbTable_ads extends Zend_Db_Table_Abstract

{

    /** Table name */

    protected $_name    = 'ads';


    public function __construct($name){

        parent::__construct();
        $this->_name = $name;

    }
}

Does Zend has something to manage this?

1
It doesn't seem to be a great idea to do it that way. - Fouad Fodail
Why you need to create tables with same structure each month. - Fouad Fodail
I have few applications that use this database and only this one uses Zend - user1927652

1 Answers

0
votes

You can create table with prefix of year+month and concatenate table name with current year+month dynamically in code:

protected $_name = "table_name_" . date("Y-m");