PHP Classes

File: examples/library/www/author_delete.php

Recommend this page to a friend!
  Classes of Victor Bolshov   Tiny PHP ORM Framework   examples/library/www/author_delete.php   Download  
File: examples/library/www/author_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: 8 years ago
Size: 419 bytes
 

Contents

Class file image Download
<?php

use \library\Registry,
    \
library\Author;

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

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

/** @var Author $author */
$author = Registry::persistenceDriver()->find((int) $_GET["id"], new Author());

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

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

header("Location: authors.php");