Cleanup unused methods and code formatting
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
require_once('DbMapping.php');
|
||||
|
||||
class BookNotFoundException extends WebException {
|
||||
@@ -7,13 +8,6 @@ class BookNotFoundException extends WebException {
|
||||
}
|
||||
}
|
||||
|
||||
function convertMSChar($src)
|
||||
{
|
||||
$text = preg_replace('/([\xc0-\xdf].)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 192) * 64 + (ord(substr('$1', 1, 1)) - 128)) . ';'", $src);
|
||||
$text = preg_replace('/([\xe0-\xef]..)/se', "'&#' . ((ord(substr('$1', 0, 1)) - 224) * 4096 + (ord(substr('$1', 1, 1)) - 128) * 64 + (ord(substr('$1', 2, 1)) - 128)) . ';'", $text);
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* AudioBook is mapped on a Notice from NetBiblio
|
||||
*
|
||||
@@ -168,24 +162,6 @@ class AudioBook extends DbMapping
|
||||
return $multiple ? $books : reset($books);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $code
|
||||
* @return int
|
||||
* @throws BookNotFoundException
|
||||
* @throws SqlException
|
||||
*/
|
||||
public static function findIdByCode($code)
|
||||
{
|
||||
$sql = "SELECT NoticeId FROM Notices WHERE LTRIM(RTRIM(NoticeNr)) = '$code';";
|
||||
$result = Connection::execute($sql, false);
|
||||
if ($result === false || $result->length == 0) {
|
||||
throw new BookNotFoundException($code);
|
||||
}
|
||||
|
||||
$row = $result->current();
|
||||
return $row['NoticeId'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of all readers (volunteers) having read at least 4 books (2 notices per book).
|
||||
* Returns an associative array containing $lastname and $firstname
|
||||
|
||||
Reference in New Issue
Block a user