Welcome Guest, Not a member yet? Register   Sign In
Gas ORM Version 2
#1

[eluser]Unknown[/eluser]
Am really getting problems with Gas ORM 2.1.2 when it comes to relationships, I tried searching through the forums bt got nothing. I have copied the exact example from the gas main website but when i call the model in the controller like this
Code:
public function show()
        {
                // load all of our posts
    $data['user'] = Model\User::with('blog')->all();
                $data['posts'] = $data['user']->blog();
    

                // build our blog table
               $this->load->view('all', $data);

        }
But i get this error

Fatal error: Call to a member function blog() on a non-object in C:\wamp\www\CodeIgniter-develop\application\controllers\Welcome.php on line 140

What am i missing or what could be the problem? Please help coz i've falled in love with this orm and i dont want to manually join two tables rather use the rich features of gas orm.


Messages In This Thread
Gas ORM Version 2 - by El Forum - 11-04-2013, 11:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB