Welcome Guest, Not a member yet? Register   Sign In
DataMapper question
#1

[eluser]scherman[/eluser]
Hi people. I'm starting with the DataMapper ORM. It looks great, but i have some problems.
I want to add the prefix to the models like "book_model" and in the DataMapper's userguide say this:

Quote:If you would use the '_model' prefix on your classes, use the class names 'book_model' and 'author_model' instead.

You would still use $obj->book and $obj->author to access the relationship.

So, i called "book_model.php" instead of "book.php", but when i do something like:

Code:
$b = new Book();

it doesn't work. I don't understand why. If i do this:

Code:
$b = new Book_model();

It works, but there are a lot of errors then with joins and other stuffs.


So, do somebody use the datamapper and tell how can i use it? I don't want to have the models without the prefix, because it'll have problems with the controller's who have the same name.

Please, help! I want advices!




Theme © iAndrew 2016 - Forum software by © MyBB