1 | <?php |
||
8 | class Icon |
||
9 | { |
||
10 | /** |
||
11 | * @var String $name : The name of the icon without the path or the extension. |
||
12 | */ |
||
13 | private $name; |
||
14 | /** |
||
15 | * @var String $fullName : The name of the icon without the path but with the extension. |
||
16 | */ |
||
17 | private $fullName; |
||
18 | /** |
||
19 | * @var String $filePath : The file path of the icon. If it is a builtin icon, then it is in the 'img' directory of the project. |
||
20 | */ |
||
21 | private $path; |
||
22 | /** |
||
23 | * @var String $shortUri : The short uri to thye image. Will be used for exports. If it is a builtin icon, value will be '/img/'. |
||
24 | */ |
||
25 | private $shortUri; |
||
26 | /** |
||
27 | * @var int $size : The size of the file. |
||
28 | */ |
||
29 | private $size; |
||
30 | /** |
||
31 | * @var String $extension : The extension of the icon file without the leading dot. If it is a builtin icon, then it is 'png'. |
||
32 | */ |
||
33 | private $extension; |
||
34 | |||
35 | /** |
||
36 | * The constructor. Use setIcon method. |
||
37 | * |
||
38 | * @param String $name : The name of the icon without the path or the extension. |
||
39 | * @param String $path : The file path of the icon. If it is a builtin icon, then it is in the 'img' directory of the project. |
||
40 | * @param String $shortUri : The short uri to thye image. Will be used for exports. If it is a builtin icon, value will be '/img/'. |
||
41 | * @param int $size : The size of the file. |
||
42 | * @param String $extension : The extension of the icon file without the leading dot. If it is a builtin icon, then it is 'png'. |
||
43 | */ |
||
44 | public function __construct($name = null, $extension = null, $path = null, $shortUri = null, $size = null) { |
||
49 | |||
50 | /** |
||
51 | * Fill all the instance attributes according to the given parameters. |
||
52 | * If only the name is given , then it will assume that a builtin icon is beeing used so the aother attributes will be filled following this logic. |
||
53 | * |
||
54 | * @param String $name : The name of the icon without the path or the extension. |
||
55 | * @param String $path : The file path of the icon. If it is a builtin icon, then it is in the 'img' directory of the project. |
||
56 | * @param String $shortUri : The short uri to thye image. Will be used for exports. If it is a builtin icon, value will be '/img/'. |
||
57 | * @param int $size : The size of the file. |
||
58 | * @param String $extension : The extension of the icon file without the leading dot. If it is a builtin icon, then it is 'png'. |
||
59 | */ |
||
60 | public function setIcon($name, $extension = null, $path = null, $shortUri = null, $size = null) { |
||
73 | |||
74 | /** |
||
75 | * Return icon name. |
||
76 | * |
||
77 | * @return String : the icon name. |
||
78 | */ |
||
79 | public function getName() { |
||
82 | |||
83 | /** |
||
84 | * Return the full icon name. |
||
85 | * |
||
86 | * @return String : the full icon name. |
||
87 | */ |
||
88 | public function getFullName() { |
||
91 | |||
92 | /** |
||
93 | * Return icon extension. |
||
94 | * |
||
95 | * @return String : the icon extension. |
||
96 | */ |
||
97 | public function getExtension() { |
||
100 | |||
101 | /** |
||
102 | * Return icon file path. |
||
103 | * |
||
104 | * @return String : the icon path. |
||
105 | */ |
||
106 | public function getPath() { |
||
109 | |||
110 | /** |
||
111 | * Return icon short uri. |
||
112 | * |
||
113 | * @return String : the icon short uri. |
||
114 | */ |
||
115 | public function getShortUri() { |
||
118 | |||
119 | /** |
||
120 | * Set the icon short uri. |
||
121 | * |
||
122 | * @return String : the icon uri. |
||
123 | */ |
||
124 | public function setShortUri($shortUri) { |
||
127 | |||
128 | /** |
||
129 | * Return icon name. |
||
130 | * |
||
131 | * @return int : the icon size. |
||
132 | */ |
||
133 | public function getSize() { |
||
136 | |||
137 | /** |
||
138 | * Transform the objects tree in an array tree. |
||
139 | * |
||
140 | * @return Array $array : The array tree. |
||
141 | */ |
||
142 | public function toArray() { |
||
145 | |||
146 | /** |
||
147 | * Magic to String method. |
||
148 | * |
||
149 | * @return String |
||
150 | */ |
||
151 | public function __toString() { |
||
154 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.