PersistenceObjects for php

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:


$user = new User();
$up = new UserPersistence($user);

Read one object

$up = new UserPersistence($userId);
$user = $up->getValueObject();

Read all objects

$up = new UserPersistence();
$userList = $up->getAll();


$up = new UserPersistence($user);


$up = new UserPersistence($user);

As you can see although the configuration might be annoying at first, the usage is heavenly.

previous - Configure DatabaseManager and create the database
next - Add database-methods