Welcome Guest, Not a member yet? Register   Sign In
DataMapper and POO => attributes of the classes and DB tables, how does it work ?
#1

[eluser]bastien31[/eluser]
Hi everybody,

I discover DataMapper today and I watched some screencast and read some examples on the datamapper website.

But, I don't understand the way it works between CI and datamapper, with a POO view.

I explain : in a basic POO way to code, in a class, you put the methods and the attributes of the class. For example, a user will have a name, a phone number and an address. You will have setter et getter and you will have method to update, create and delete a user and the datas of this user.

But, with DataMapper, in the model class of a user, there are not the attributes... The only place where I can see them is in the $validation variable. So, my conclusion is that when you create a user with "new" with a DataMapper model, the attributes are created as it is in the table with wich they are linked ?

I am really not sure I understand it the good way, and as you can see, I m not really familiar with it. Can anybody explain me ?? Smile

thanks !

bastien




Theme © iAndrew 2016 - Forum software by © MyBB