Having a very strange issue with an error on a codeigniter site.
Fatal error: Call to undefined method Document::get_by_module()
The line of code causing this (in a controller) is:
$this->document_type->get_by_module('module1');
The constructor of the controller:
function __construct(){
parent::__construct();
$this->load->model('document','document_type');
}
The document_type class looks like this
class Document_type extends CI_Model {
function Document_type () {
parent::__construct();
}
function get_by_module($prefix) {
// code
}
}
The main issue I'm seeing is that it's saying Document::
is the class, but it should be Document_type
. I see no reason that it should be looking in the document class for that function.
If I remove loading of the 'document' class from the controller constructor, the error goes away (but other things break).
Not sure how something like that could be happening.