| Total Complexity | 12 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Image extends File { |
||
| 10 | |||
| 11 | protected static $validExtensions = ['jpg', 'jpeg', 'gif', 'png']; |
||
| 12 | |||
| 13 | /* @overwrite */ |
||
| 14 | |||
| 15 | public function upload($newName = '') { |
||
| 16 | $error = parent::upload($newName); |
||
| 17 | if ($this->uploadPrepared && is_null($error)) { |
||
| 18 | $error = $this->saveThumb(); |
||
| 19 | } |
||
| 20 | return $error; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function saveThumb() { |
||
| 24 | return false; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function __toString() { |
||
| 28 | if ($this->getName() != '') { |
||
| 29 | return parent::__toString(); |
||
| 30 | } else { |
||
| 31 | return $this->getFullName(); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | public function getFullName() { |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | public function removeOld() { |
||
| 44 | $this->clearCache($this->getOldName()); |
||
| 45 | parent::removeOld(); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function remove() { |
||
| 51 | } |
||
| 52 | |||
| 53 | /** Limpa imagens em cache */ |
||
| 54 | public function clearCache($name) { |
||
| 58 | } |
||
| 59 | } |
||
| 60 | |||
| 62 |