| Total Complexity | 6 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | class Asset extends Field |
||
| 13 | { |
||
| 14 | public function __construct($content, $block) |
||
| 15 | { |
||
| 16 | parent::__construct($content, $block); |
||
| 17 | |||
| 18 | if (isset($this->content['filename'])) { |
||
| 19 | $this->content['filename'] = str_replace('a.storyblok.com', config('storyblok.asset_domain'), $this->content['filename']); |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | public function __toString() |
||
| 24 | { |
||
| 25 | if ($this->content['filename']) { |
||
| 26 | return $this->content['filename']; |
||
| 27 | } |
||
| 28 | |||
| 29 | return ''; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Checks a file was uploaded |
||
| 34 | * |
||
| 35 | * @return bool |
||
| 36 | */ |
||
| 37 | public function hasFile() { |
||
| 43 | } |
||
| 44 | } |
||
| 45 |