Hello there. I'm just starting out with Flourish and I'm already in need of assistance.
My problem is this: I like to organize my classes the way the Zend Framework does it (i.e My_Awesome_Class = My/Awesome/Class.php) and so I was trying to apply this to my fActiveRecord classes. I have two tables; "users" and "posts", my classes are named Record_User and Record_Post respectively and I have used fORM::mapClassToTable() to configure the classes properly (I think?). Now, here's the code I'm trying to execute:
$u = new Record_User(1); // user already exists
$posts = $u->buildPosts(); // I've already got some posts in the database, too
However, I get the following error:
The class specified, Post, does not appear to be a valid fActiveRecord class
And indeed, "Post" is not a valid class. How can I make ensure that "Record_Post" is used instead and that this results in a collection of posts instead of an error? I've tried all this without adhering to my class naming habits and it works, but that won't do. Also, the classes:
class Record_User extends fActiveRecord {
protected function configure() {
fORM::mapClassToTable($this, 'users');
}
}
class Record_Post extends fActiveRecord {
protected function configure() {
fORM::mapClassToTable($this, 'posts');
}
}
Thanks in advance!