- 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
Advanced: Delete(deep)
When an object is identified as “Parent", POG generates the object with a slightly different Delete CRUD method. The modified Delete method is known as Delete($DEEP). The Delete($DEEP) method extends the functionality of the traditional DELETE method by allowing you to recursively delete all child objects associated with the parent object. By default, parent objects are NOT deleted deep if the $deep parameter is not specified.
When an object is identified as "Sibling", POG generates the object with a slightly different Delete CRUD method. The modified Delete method is known as Delete($DEEP,$ACROSS). The Delete($DEEP,$ACROSS) method extends the functionality of the traditional DELETE method by allowing you to choose whether you want to delete down or across the 'family tree'. If across is set to true and deep is set to false, then all siblings of the current object will be deleted *recursively*. If the sibling object has any children itself, these child objects will not be deleted.
PHP:
//To Delete an object ‘deep’, simply do the following:
$book = new Book( ) ; //create a child object
$book -> title = " State of Fear" ;
$author = new Author ( ) ; //create a parent object
$author -> name = ‘Michael Critchton’ ;
$author -> AddBook($book) ;
$author -> Delete ( t rue) ; //deletes both Author and Book
//Note: Delete(true) different from Delete():
//To Delete an object ‘shallow’, simply do the following:
$book = new Book( ) ; //create a child object
$book -> t i t le = " State of Fear " ;
$author = new Author( ) ; //create a parent object
$author -> name = ‘Michael Critchton’ ;
$author -> AddBook($book) ;
$author -> Delete (false) ; //Deletes only Author object
//Note: Delete(false) is the same as Delete()
$book = new Book( ) ; //create a child object
$book -> title = " State of Fear" ;
$author = new Author ( ) ; //create a parent object
$author -> name = ‘Michael Critchton’ ;
$author -> AddBook($book) ;
$author -> Delete ( t rue) ; //deletes both Author and Book
//Note: Delete(true) different from Delete():
//To Delete an object ‘shallow’, simply do the following:
$book = new Book( ) ; //create a child object
$book -> t i t le = " State of Fear " ;
$author = new Author( ) ; //create a parent object
$author -> name = ‘Michael Critchton’ ;
$author -> AddBook($book) ;
$author -> Delete (false) ; //Deletes only Author object
//Note: Delete(false) is the same as Delete()


