1 | <?php |
||
8 | class Ajde_Resource_FileIcon extends Ajde_Resource |
||
9 | { |
||
10 | private $_iconCdn = 'http://p.yusukekamiyamane.com/icons/search/fugue/icons/%s.png'; |
||
11 | private $_iconDictionary = [ |
||
12 | '*' => 'document', |
||
13 | 'jpg' => 'document-image', |
||
14 | 'gif' => 'document-image', |
||
15 | 'png' => 'document-image', |
||
16 | 'bmp' => 'document-image', |
||
17 | 'xls' => 'document-excel', |
||
18 | 'xlsx' => 'document-excel', |
||
19 | 'ppt' => 'document-powerpoint', |
||
20 | 'pptx' => 'document-powerpoint', |
||
21 | 'doc' => 'document-word', |
||
22 | 'docx' => 'document-word', |
||
23 | 'pdf' => 'document-pdf', |
||
24 | 'mp3' => 'document-music', |
||
25 | 'wav' => 'document-music', |
||
26 | 'zip' => 'folder-zipper', |
||
27 | 'mpg' => 'film', |
||
28 | 'avi' => 'film', |
||
29 | ]; |
||
30 | |||
31 | public function __construct($fileExtension) |
||
35 | |||
36 | public static function _($fileExtension) |
||
42 | |||
43 | public function getFilename() |
||
47 | |||
48 | public function __toString() |
||
52 | |||
53 | protected function getLinkUrl() |
||
58 | } |
||
59 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: