
Originally Posted by
oikram
Oddz do you still use a DAO per table or you have a generic DAO?
No – I have been using a ActiveRecord based system.
PHP Code:
$user = new User(
array(
'username'=>'isausername'
,'password'=>'isapassword'
,'email'=>'sa@email.com'
,'profile'=>new Profile(
array(
'firstname'=>'isafirstname'
,'lastname'=>'isalastname'
,'page'=>'isaage'
)
)
)
);
$user->save();
PHP Code:
$user = User::find(
'one'
,array(
'include'=>'profile'
,'username'=>'isausername'
)
);
$user['profile']['lastname'];
You can catch a glimpse of the evolving library here if you like.
It all works on a generic level once the tables have been defined in terms of relationships, fields, etc.
Bookmarks