PHP Classes

File: example/delete.php

Recommend this page to a friend!
  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: 19 years ago
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->get( 10 ) > 0) {
   
$person->delete();
}

?>