- 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
Customizing: Extending POG Objects
Extending POG objects is recommended when your customization is limited to a particular set of business rules for a web application. Extending POG objects involves grouping your changes in a separate PHP class (and separate file) so that you can regenerate and overwrite your POG objects at any time during the development cycle, without losing any changes you’ve made.
Extending PHP classes
One of the big advantages of using OOP in PHP is that you can extend classes, i.e. make classes that build upon each other, avoid code repetition. Creating a new class which builds on an existing class allows the new class to use all the public methods of the base class while allowing you to define new methods as well. Thus you can hopefully see that by extending POG classes, you can have access to all CRUD methods generated by POG (Get(), GetList(), Save() etc) and also define your own customized methods.
Example:
Let’s assume you generate a Book and Author objects in POG, and you want to add a new function that will allow you to know if a Book has more than one author:
- Create a new class called MyBook which extends Book
- Create a function in MyBook that has a function called HasMultipleAuthors()
- Simply call $mybook->HasMultipleAuthors()


