1. Create the model classes
2. Create a test
3. Create the PersistenceObjects
4. Describe the classes
5. Configure DatabaseManager and create the database
> 6. Use the PersistenceObjects in your controllers
7. Add database-methods
6. Use the PersistenceObjects in your controllers
This last step is up to you. You can start using the PersistenceObjects. Basic CRUD operations can be performed as follows:
Create
$user = new User(); $user->setUserName("luuseri"); $up = new UserPersistence($user); $up->persist();
Read one object
$up = new UserPersistence($userId); $user = $up->getValueObject();
Read all objects
$up = new UserPersistence(); $userList = $up->getAll();
Update
$up = new UserPersistence($user); $up->merge();
Delete
$up = new UserPersistence($user); $up->delete();
As you can see although the configuration might be annoying at first, the usage is heavenly.
previous - Configure DatabaseManager and create the databasenext - Add database-methods