[eluser]Skuja[/eluser]
In the following code the functions of m_galleries model is not working (i guess that model is not loaded) . But those functions works when i call $this->load->model() in M_languages contructor. So is it possible somehow to load galleries_model only in delete() function, because I do not want to load it every time any other function of languages model is called? I need it only for particular delete function.
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class M_languages extends Model {
function M_languages()
{
parent::Model();
}
function delete($language_id)
{
$language = $this->get_by_id($language_id);
$this->db->where('id',$language_id);
$this->db->delete('languages');
$this->load->model('m_galleries','galleries_model');
$this->galleries_model->delete_by_lang_id($language_id);
}
}
?>