|
Method delObject( $oObject, $bDeleteCollections = false ) |
|
Written by Hidalgo Emmanuel
|
|
Description :
Allows to remove a object of a collection.
Parameters :
$oObject, object : This parameter represents the object to be removed. $bDeleteCollection (optional), Boolean: This parameter allows the release of the suppression of the objects in cascade, all the collections of the objects children will be they also removed (attention, the concept of level of suppression does not exist).
Value of return :
No parameter of return.
The following example removes a user of a collection of “users” :
<?php
//total instanciation include_once( 'phpsimpledb.class.php' ); Global $oBDD; $oBDD = new PHPSIMPLEDB(); // recover a collection of “users” $oUsers_col = $oBDD->getCollection( "users" ); $oUsers_col->load( "level = 2" ); // recover the first recording $oUsers = $oUsers_col->getObjects(); $oUser = $oUsers[ 0 ]; // remove it “user” $oUsers_col->delObject( $oUser );
?>
|
|