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
2. Create a test
Not really necessary but quite handy when attempting to create a new project from nothing. The test we're about to create tells us if the configuration is acceptable. The test looks like this:
<pre> require_once "persistenceobjects/UserPersistence.php"; require_once "persistenceobjects/PicturePersistence.php"; require_once "persistenceobjects/AlbumPersistence.php"; $userPersistence = new UserPersistence(); $userPersistence->validateTableAndDescriptorSetup(); $albumPersistence = new AlbumPersistence(); $albumPersistence->validateTableAndDescriptorSetup(); $picturePersistence = new PicturePersistence(); $picturePersistence->validateTableAndDescriptorSetup(); </pre>
Now if you run the file in a browser it announces errors, because we haven't got the necessary files yet. Let's see to that.
previous - Create the model classes
next - Create the PersistenceObjects