PHP Classes
elePHPant
Icontem

File: examples/library/www/edition_delete.php

Recommend this page to a friend!
  Classes of Victor Bolshov  >  Tiny PHP ORM Framework  >  examples/library/www/edition_delete.php  >  Download  
File: examples/library/www/edition_delete.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Tiny PHP ORM Framework
Map objects to databases using composed queries
Author: By
Last change:
Date: 2 years ago
Size: 434 bytes
 

Contents

Class file image Download
<?php

use \library\Registry,
    \
library\scaffold\Edition;

include
__DIR__ . "/../bootstrap.php";

if (empty(
$_GET["id"])) {
    die(
"No edition ID provided");
}

$edition = Registry::persistenceDriver()->find((int) $_GET["id"], new Edition());

if (!
$edition) {
    die(
"Edition #" . (int) $_GET["id"] . " not found");
}

Registry::persistenceDriver()->delete($edition);

header("Location: book_edit.php?id=" . $edition->book_id);