@@ 21-32 (lines=12) @@ | ||
18 | return $book; |
|
19 | } |
|
20 | ||
21 | public function includeAuthor(array $book) |
|
22 | { |
|
23 | if (!array_key_exists('_author', $book)) { |
|
24 | return; |
|
25 | } |
|
26 | ||
27 | if ($book['_author'] === null) { |
|
28 | return $this->null(); |
|
29 | } |
|
30 | ||
31 | return $this->item($book['_author'], new JsonApiAuthorTransformer(), 'people'); |
|
32 | } |
|
33 | ||
34 | public function includeCoAuthor(array $book) |
|
35 | { |
|
@@ 34-45 (lines=12) @@ | ||
31 | return $this->item($book['_author'], new JsonApiAuthorTransformer(), 'people'); |
|
32 | } |
|
33 | ||
34 | public function includeCoAuthor(array $book) |
|
35 | { |
|
36 | if (!array_key_exists('_co_author', $book)) { |
|
37 | return; |
|
38 | } |
|
39 | ||
40 | if ($book['_co_author'] === null) { |
|
41 | return $this->null(); |
|
42 | } |
|
43 | ||
44 | return $this->item($book['_co_author'], new JsonApiAuthorTransformer(), 'people'); |
|
45 | } |
|
46 | } |
|
47 |