• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gas ORM Version 2

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
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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.