/** * insert one confirmationRegistry in the database * * @author Jonathan Sandoval <*****@*****.**> * @param ConfirmationRegistry $confirmationRegistry The confirmationRegistry to insert * @return boolean If was possible to insert */ static function addConfirmationRegistry($confirmationRegistry = null) { if ($confirmationRegistry === null) { return false; } $number = $confirmationRegistry->getNumber(); $book = $confirmationRegistry->getBook(); $page = $confirmationRegistry->getPage(); $reverse = $confirmationRegistry->getReverse(); $singleConfirmationRegistry = self::getSingleConfirmationRegistry('number', $number, 'book', $book, 'page', $page, 'reverse', $reverse); if ($singleConfirmationRegistry === null) { $TableConfirmationReg = DatabaseManager::getNameTable('TABLE_CONFIRMATION_REGISTRY'); $query = "INSERT INTO {$TableConfirmationReg}\r\n (number, book, page, reverse)\r\n VALUES \r\n ('{$number}', '{$book}', '{$page}', '{$reverse}')"; return DatabaseManager::singleAffectedRow($query); } else { return false; } }