
- Introduction to POG
- Setting up PHP, MySQL etc.
- Designing your objects
- Generating your code
- Description of the generated code
- Edit configuration file
- The Setup Process
- Using the code: Save()
- Using the code: Get()
- Using the code: SaveNew()
- Using the code: GetList()
- Using the code: Delete()
- Using the code: DeleteList()
- Advanced: object relations
- Advanced: Set{Parent}()
- Advanced: Get{Parent}()
- Advanced: Add{Child}()
- Advanced: Get{Child}List()
- Advanced: Save(deep)
- Advanced: Delete(deep)
- Advanced: Add{Sibling}()
- Advanced: Set{Child}List()
- Advanced: Set{Sibling}List()
- Advanced: Get{Sibling}List()
- Advanced: DeleteList(deep)
- Customizing POG-generated code
- Customizing: Extending POG Objects
- Customizing: Plugins
- Examples
- Examples: User registration system
- Examples: User authentication
- Examples: Survey form
- Examples: Using POG with AJAX
- PDO: Introduction
- PDO: SQLite example
- PDO: Firebird example
- PDO: PostgreSQL example
- PDO: MySQL example
- PDO: ODBC example
- Troubleshooting
- Troubleshooting: Data appears encoded
- Troubleshooting: Can't regenerate object
- Troubleshooting: Can't seem to Save()
- Troubleshooting: Can't get object / object attributes from database
- Troubleshooting: Can't open zip file on Mac
- Troubleshooting: Setup screen is blank
- Videos
- Appendix: Creating table(s) manually
- Appendix: Regenerating objects
- Appendix: Generating objects using SOAP
- Case Study: Gravity GTD
- Case Study: Web Form Factory

Back to the Code Generator
The POG Weblog and RSS feed.
The POG Google group
The Setup Process
The setup process is a 3-step process which extends the usefulness of PHP Object Generator. It automates the actions the developer would normally do after code generation is performed. Here’s an overview of the 3 steps:
Step 1 gives instructions and explains what will happen in steup 2 and 3. Step 1 also allows you to choose from 3 options:
#Align objects with tables #Drop and recreate tables #Drop, recreate tables and initialize data
Align objects with tables
If this option is chosen, during step2, Setup will simply analyze your database and compare and align it with the objects in the /objects folder. If an object exists and there isn’t a corresponding table for it in the database, the table will be created. If there is already a table but the columns do not match the object attributes exactly, the table will be modified so that it corresponds to what’s been defined in the object. If both object and table are aligned, no further action is taken.
Drop and recreate tables
All tables that have a corresponding object in the /objects folder are dropped and recreated in step 2.
Drop, recreate tables and initialize data
Same as “Drop and recreate tables”, with 1 added functionality: After the tables are recreated, any SQL statement present in /setup/data_initialization.sql is executed. This is useful, if, for instance, your application requires some initialization data.
During Step 2, POG checks your configuration file, aligns your tables with the objects and performs unit testing on all the objects found in your /objects folder. If needed, POG Setup will create the table(s) for your object(s). If you decide later on to manually make code changes to your objects, running setup is an excellent and easy way to test if your objects still work properly. After all tests are completed, POG provides you with a set of diagnostic messages. If all tests succeeded, you will be able to proceed to step 3.
In Step 3, you’re provided with a light interface to your database objects.
Now, let’s begin the setup process. Once you’ve extracted the content of the zipped file into a file on your server, access the setup folder from within your browser as follows:
You’ll be presented with a setup screen. This is the first of a 3-step process:
Read the instructions on the first page. When you’re done, click on the “POG ME UP” button at the bottom.
POG Setup will then perform unit testing and present you with some diagnostic messages. If everything went well, you should see something like this:
Clicking on the proceed button will push you to the 3rd step: A light interface to your database objects:
This interface provides a way for you to quickly add, delete and update objects in your database. In short, it acts as a control panel at various stage of your development, where you can always come back to check on your objects.
For more information on how to use the objects in your own code, take a look at the “Using the code” series of articles. They cover the 5 CRUD methods and how to use them in your code.