1 | <?php |
||
11 | class Image extends File { |
||
12 | |||
13 | const QUALITY = 70; |
||
14 | const MAX_HEIGHT = 900; |
||
15 | const MAX_WIDTH = 1200; |
||
16 | |||
17 | protected static $validExtensions = ['jpg', 'jpeg', 'gif', 'png']; |
||
18 | |||
19 | /* @overwrite */ |
||
20 | |||
21 | function upload($newName = '') { |
||
28 | |||
29 | /** |
||
30 | * Gera a miniatura |
||
31 | * @return string Retorna o caminho da thumb |
||
32 | * @param int $width largura |
||
33 | * @param int $height altura |
||
34 | * @param boolean $mode modo de corte |
||
35 | */ |
||
36 | function showThumb($width = 100, $height = 100, $mode = 'normal') { |
||
39 | |||
40 | /** |
||
41 | * Cria uma miniatura da imagem |
||
42 | * @return string |
||
43 | */ |
||
44 | function saveThumb() { |
||
53 | |||
54 | public function __toString() { |
||
61 | |||
62 | public function getFullName() { |
||
69 | |||
70 | public function removeOld() { |
||
74 | |||
75 | public function remove() { |
||
79 | |||
80 | /** Limpa imagens em cache */ |
||
81 | public function clearCache($name) { |
||
87 | |||
88 | } |
||
89 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.