this is my problem. I’m using codeigniter and this is my structure. I have 2 classes in 2 files
class Model_setup extends CI_Model
{
//functions
// an update function
public function update()
{
// update stuff
}
}
// OTHER FILE
class Tests extends Model_setup
{
// other functions....
// a totally different update function
public function update()
{
// update a specific set of stuff
}
}
I want to know if and how it is possible to reference these two separate update functions. In a separate controller from these two, say the Places_Controller how would you tell the difference between these two class methods and how would you make sure that you are only using one or the other of the two updates? Thank you for the help in advance.
So I was enlightened by a friend about how to solve this. This doesn’t need any codeigniter frmaework stuff to be made to work correctly. The following would work correctly:
Now from the outside world, say another controller in the framework you can call the following once everything has been loaded.
$this->tests_model->parent_update($x)when you wish to call the parent version and$this->tests_model->updatewhen you wish to call theupdatefunction for the Tests model. This worked and I have tested this.