[eluser]Unknown[/eluser]
Is it possible to load a model within a model?
For example, I have two models (Contact and Contact_Meta) and a controller (Admin).
Any help is appreciated.
Within Admin.php:
Code:
...
$this->load->model('contact');
$this->contact->delete_contact($contact_id);
...
Within Contact.php
Code:
...
function delete_contact ($contact_id)
{
$this->load->model('contact_meta');
$this->contact_meta->delete($contact_id); // fails here with the message: Undefined property: Contact::$contact_meta
$this->db->where('contact_id',$contact_id);
$this->db->delete('contact');
}
...
Within Contact_Meta.php
Code:
...
function delete_contact_meta ($contact_id)
{
$this->db->where('contact_id',$contact_id);
$this->db->delete('contact_meta');
}
...