| @@ 77-88 (lines=12) @@ | ||
| 74 | return $this->belongsToMany('Colligator\Collection'); |
|
| 75 | } |
|
| 76 | ||
| 77 | public function storeCover($url) |
|
| 78 | { |
|
| 79 | $cover = $this->cover; |
|
| 80 | if (is_null($cover)) { |
|
| 81 | $cover = new Cover(['document_id' => $this->id]); |
|
| 82 | } |
|
| 83 | $cover->url = $url; |
|
| 84 | $cover->cache(); |
|
| 85 | $cover->save(); |
|
| 86 | ||
| 87 | return $cover; |
|
| 88 | } |
|
| 89 | ||
| 90 | public function storeCoverFromBlob($blob) |
|
| 91 | { |
|
| @@ 90-101 (lines=12) @@ | ||
| 87 | return $cover; |
|
| 88 | } |
|
| 89 | ||
| 90 | public function storeCoverFromBlob($blob) |
|
| 91 | { |
|
| 92 | $cover = $this->cover; |
|
| 93 | if (is_null($cover)) { |
|
| 94 | $cover = new Cover(['document_id' => $this->id]); |
|
| 95 | } |
|
| 96 | $cover->url = null; |
|
| 97 | $cover->cache($blob); |
|
| 98 | $cover->save(); |
|
| 99 | ||
| 100 | return $cover; |
|
| 101 | } |
|
| 102 | ||
| 103 | public function setCannotFindCover() |
|
| 104 | { |
|