44 lines
962 B
PHP
Raw Permalink Normal View History

2023-01-24 19:00:39 +01:00
<?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;
}
}