<?
require_once("classes/Cart.class.php");
require_once("header.php");
// Getting the persistence manager
$persistence = new Persistence();
// We use phpersistence to get the cart object.
$currentCart = $persistence->getById("Cart", 1);
/**
* "delete" deletes an object and all linked objects configured with cascade = "all" or "delete"
* (in the phpersistence.conf.php file)
*
* The second optional boolean parameter may be set to false
* if the instance should not be deleted from memory.
* By default, the object instance is set to null.
*
* In this example the products and the user linked to this cart are not deleted
* because the cascade is mapped "save-update" for the user and "none" for the products.
* (see the conf file at end of demo)
*
*/
$persistence->delete($currentCart);
// Logger::debug prints a dump of the object
Logger::debug($currentCart);
?>