Welcome Guest, Not a member yet? Register   Sign In
Where to put plain object classes?
#30

(12-30-2014, 10:11 AM)includebeer Wrote: Why would it cough up CI properties?

Code:
    public function __get($key)
    {
        // Debugging note:
        //    If you're here because you're getting an error message
        //    saying 'Undefined Property: system/core/Model.php', it's
        //    most likely a typo in your model code.
        return get_instance()->$key;
    }

That's what this code does. The primary purpose of extending CI_Model is more or less to utilize this function, usually for the purposes of accessing $this->db from within your model.
Reply


Messages In This Thread
Where to put plain object classes? - by geekita - 12-02-2014, 05:51 AM
RE: Where to put plain object classes? - by mwhitney - 12-30-2014, 02:59 PM
RE: Where to put plain object classes? - by Jamie - 01-06-2015, 05:18 AM
RE: Where to put plain object classes? - by Jamie - 01-06-2015, 03:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB