44 lines
962 B
PHP
44 lines
962 B
PHP
![]() |
<?php
|
||
|
|
||
|
class book extends _publication {
|
||
|
|
||
|
protected $type = 2;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// each type has its own master record
|
||
|
// THIS ONLY ADDS article (master of publication)
|
||
|
protected function _addMaster() {
|
||
|
|
||
|
if (!$this->_isPublisher()) {
|
||
|
$this->_addPublisher();
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
$stmt = $this->PDO->prepare("INSERT INTO p_book (title, id_publisher, city) VALUES (:title, :id_publisher, :city)");
|
||
|
|
||
|
$stmt->execute(array(
|
||
|
'title' => $this->pub_name,
|
||
|
'id_publisher' => $this->publisher_id,
|
||
|
'city' => $this->city));
|
||
|
|
||
|
$master_id = $this->PDO->lastInsertId();
|
||
|
|
||
|
return $master_id;
|
||
|
}
|
||
|
catch (exception $ex) {
|
||
|
common::except ('Err: ' .$ex .' in ' .__DIR__ .'/' .__FILE__ .':' .__LINE__);
|
||
|
}
|
||
|
|
||
|
|
||
|
return false;
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|