PHP Classes
elePHPant
Icontem

File: examples/library/www/edition_save.php

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

Contents

Class file image Download
<?php

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

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

$edition = new Edition($_POST);
$edition->id = ((int) $edition->id) ?: null;
$edition->book_id = (int) $edition->book_id;
$edition->year = (int) $edition->year;
$edition->isbn = (string) $edition->isbn;
$edition->instance_count = (int) $edition->instance_count;

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

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