It looks like you're new here. If you want to get involved, click one of these buttons!
this obviously fails, because the record object has no way to reach the model (unless the $this->language is a variable of the record object, which is not what i'm looking for)
class Blocks_model extends Base_module_model {
public $language = 'en_EN';
(...)
}
class Block_model extends Base_module_record {
function get_language()
{
return $this->language
}
}
which is a less than optimal solution on many ways... Especially because if you're dealing with the record object -- say, from a controller - that means you've loaded the module already anyway...
class Block_model extends Base_module_record {
function get_language()
{
$CI = &get_instance();
$CI->load->module_model('fuel', 'blocks_model');
return $CI->blocks_model->language;
}
}
Comments
class Block_model extends Base_module_record { function get_language() { return $this->_parent_model->language; } }
Here is the other way around, if you need a record object in the model (to access a certain method or formatted strings).
$this->map_to_record_class($val)
is the key.