Fix a warning in case the book has no tag or author
This commit is contained in:
parent
563a90cf5d
commit
6d94c2d4c1
24
book.php
24
book.php
|
@ -138,17 +138,7 @@ class Book extends Base {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAuthorsName () {
|
public function getAuthorsName () {
|
||||||
$authorList = null;
|
return implode (", ", array_map (function ($author) { return $author->name; }, $this->getAuthors ()));
|
||||||
foreach ($this->getAuthors () as $author) {
|
|
||||||
if ($authorList) {
|
|
||||||
$authorList = $authorList . ", " . $author->name;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$authorList = $author->name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $authorList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSerie () {
|
public function getSerie () {
|
||||||
|
@ -220,17 +210,7 @@ class Book extends Base {
|
||||||
|
|
||||||
|
|
||||||
public function getTagsName () {
|
public function getTagsName () {
|
||||||
$tagList = null;
|
return implode (", ", array_map (function ($tag) { return $tag->name; }, $this->getTags ()));
|
||||||
foreach ($this->getTags () as $tag) {
|
|
||||||
if ($tagList) {
|
|
||||||
$tagList = $tagList . ", " . $tag->name;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$tagList = $tag->name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $tagList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRating () {
|
public function getRating () {
|
||||||
|
|
Loading…
Reference in a new issue