forked from seblucas/cops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EntryBook.php
47 lines (41 loc) · 1.22 KB
/
EntryBook.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* COPS (Calibre OPDS PHP Server) class file
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Sébastien Lucas <[email protected]>
*/
class EntryBook extends Entry
{
public $book;
/**
* EntryBook constructor.
* @param string $ptitle
* @param integer $pid
* @param string $pcontent
* @param string $pcontentType
* @param array $plinkArray
* @param Book $pbook
*/
public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pbook) {
parent::__construct ($ptitle, $pid, $pcontent, $pcontentType, $plinkArray);
$this->book = $pbook;
$this->localUpdated = $pbook->timestamp;
}
public function getCoverThumbnail () {
foreach ($this->linkArray as $link) {
/* @var $link LinkNavigation */
if ($link->rel == Link::OPDS_THUMBNAIL_TYPE)
return $link->hrefXhtml ();
}
return null;
}
public function getCover () {
foreach ($this->linkArray as $link) {
/* @var $link LinkNavigation */
if ($link->rel == Link::OPDS_IMAGE_TYPE)
return $link->hrefXhtml ();
}
return null;
}
}