Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord for CodeIgniter: Rails-style model interactions
#58

[eluser]frith[/eluser]
Hey Chromice,
I like where you've taken this and I'm trying to implement your example code $books = $this->book->joining_related_genres->find_all(); but getting notice level errors Undefined property: Book::$joining_related_genres
Then since it's undefined I get Call to a member function find_all() on a non-object
Not sure what i'm doing wrong... have activerecord auto loading in my config. Have models for author.php, book.php, genre.php exactly as you posted in the wiki also have tables authors, books, genres and authors_books.

Any advice?

EDIT: It seems it was a syntax problem
Code:
$books = $this->book->joining_related_genres->find_all();
should have been
Code:
$books = $this->book->joining_related_genres()->find_all();

Chromice you may want to update your wiki page.


Messages In This Thread
ActiveRecord for CodeIgniter: Rails-style model interactions - by El Forum - 11-15-2007, 02:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB