It looks like you're new here. If you want to get involved, click one of these buttons!
class Member_emails_model extends MY_Model {
public $record_class = 'Member_email';
public $foreign_keys = array('member_id' => 'members_model');
function __construct()
{
parent::__construct('member_emails');
}
function _common_query()
{
$this->db->select('member_emails.*');
$this->db->join('members', 'member_emails.member_id = members.id', 'left');
}
}
class Member_email_model extends Data_record {
}
$CI->load->model('member_emails_model');
$emails = $CI->member_emails_model->find_one_by_member_id($memberId);
Comments
Looks like you might be trying to do $emails['some_field'] when it's an object so should be using $emails->some_field