Login   Register  
PHP Classes
elePHPant
Icontem

File: example/delete.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Hugo Ferreira da Silva  >  Lumine  >  example/delete.php  >  Download  
File: example/delete.php
Role: Example script
Content type: text/plain
Description: How to delete objects
Class: Lumine
Object-relational mapping tool
Author: By
Last change:
Date: 2005-10-26 13:56
Size: 486 bytes
 

Contents

Class file image Download
<?php

require_once '../lumine/LumineConfiguration.php';
$conf = new LumineConfiguration("lumine-conf.xml");

/* show up whats happen */
// LumineLog::setLevel(4);
// LumineLog::setOutput('browser');

Util::import("com.domain.classes.Person");

/** 
* the on delete and on update in car relationship mapping is to cascade, so
* when deleting a person will automatically delete the cars
*/
$person = new Person;
if( 
$person->get10 ) > 0) {
    
$person->delete();
}

?>