Refactoring again
This commit is contained in:
parent
50ae991e95
commit
a6b52887ff
2 changed files with 15 additions and 11 deletions
15
data.php
15
data.php
|
@ -76,7 +76,7 @@ class Data extends Base {
|
|||
}
|
||||
|
||||
finfo_close($finfo);
|
||||
|
||||
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
@ -124,6 +124,19 @@ class Data extends Base {
|
|||
}
|
||||
}
|
||||
|
||||
public static function getDataByBook ($book) {
|
||||
$out = array ();
|
||||
$result = parent::getDb ()->prepare('select id, format, name
|
||||
from data where book = ?');
|
||||
$result->execute (array ($book->id));
|
||||
|
||||
while ($post = $result->fetchObject ())
|
||||
{
|
||||
array_push ($out, new Data ($post, $book));
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
public static function getLink ($book, $type, $mime, $rel, $filename, $idData, $title = NULL, $height = NULL)
|
||||
{
|
||||
global $config;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue