Fix a warning in case the book has no tag or author
这个提交存在于:
父节点
563a90cf5d
当前提交
6d94c2d4c1
共有 1 个文件被更改,包括 2 次插入 和 22 次删除
24
book.php
24
book.php
|
|
@ -138,17 +138,7 @@ class Book extends Base {
|
|||
}
|
||||
|
||||
public function getAuthorsName () {
|
||||
$authorList = null;
|
||||
foreach ($this->getAuthors () as $author) {
|
||||
if ($authorList) {
|
||||
$authorList = $authorList . ", " . $author->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$authorList = $author->name;
|
||||
}
|
||||
}
|
||||
return $authorList;
|
||||
return implode (", ", array_map (function ($author) { return $author->name; }, $this->getAuthors ()));
|
||||
}
|
||||
|
||||
public function getSerie () {
|
||||
|
|
@ -220,17 +210,7 @@ class Book extends Base {
|
|||
|
||||
|
||||
public function getTagsName () {
|
||||
$tagList = null;
|
||||
foreach ($this->getTags () as $tag) {
|
||||
if ($tagList) {
|
||||
$tagList = $tagList . ", " . $tag->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tagList = $tag->name;
|
||||
}
|
||||
}
|
||||
return $tagList;
|
||||
return implode (", ", array_map (function ($tag) { return $tag->name; }, $this->getTags ()));
|
||||
}
|
||||
|
||||
public function getRating () {
|
||||
|
|
|
|||
正在加载…
添加表格
添加链接
在新工单中引用