Good practices for a Model that interacts with 2 tables?

1

I am building an MVC application, to be more exact for sending SMS messages, and I came across the following situation: I own the smsModel which is mainly responsible for sending, scheduling, canceling sending the SMS, and it has a standard table that is some information, for example, price per unit shipment, price for multiple sending and etc, basically all the methods that interact with the database use this table, but there is a responsible method for saving a shipping history and it uses another table, and I would like to know if it is a good practice to change the table name within the own method that makes this history or create a Model just for that purpose, the structure is basically this:

abstract class Model {

    protected function create (array $data) {

        $create_table = $this->table_name;
        //insere no banco
    }

}

class smsModel extends Model {

    private $table_name = 'sms_config';
    private $log_table_name = 'sms_log';

    public function create (array $data) {

        return parent::create($data);
    }

    public function create_sms_log (array $data) {
        $this->table_name = $this->log_table_name;
        return parent::create($data);

    }

}
    
asked by anonymous 23.01.2018 / 04:56

0 answers