1 | <?php |
||
26 | abstract class AbstractLoader |
||
27 | { |
||
28 | /** |
||
29 | * The content from the entity |
||
30 | * |
||
31 | * @var mixed |
||
32 | */ |
||
33 | protected $content; |
||
34 | |||
35 | /** |
||
36 | * The passed entity to be loaded |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $entity; |
||
41 | |||
42 | /** |
||
43 | * The supported extensions |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | public static $supported = array(); |
||
48 | |||
49 | /** |
||
50 | * Construct the loader with the passed entity |
||
51 | * |
||
52 | * @param string $entity The passed entity |
||
53 | */ |
||
54 | 76 | public function __construct($entity) |
|
58 | |||
59 | /** |
||
60 | * The function what loads the content from the entity |
||
61 | * |
||
62 | * @return mixed |
||
63 | */ |
||
64 | abstract public function load(); |
||
65 | |||
66 | /** |
||
67 | * Checks whether the loader supports the file extension |
||
68 | * |
||
69 | * @return bool Does the loader support the file |
||
70 | */ |
||
71 | 75 | public function supports() |
|
76 | |||
77 | /** |
||
78 | * Sets what the loader supports |
||
79 | * |
||
80 | * @param array $supports Set the extensions the loader supports |
||
81 | */ |
||
82 | 7 | public function setSupports(array $supports) |
|
86 | |||
87 | /** |
||
88 | * Returns the content |
||
89 | * |
||
90 | * @return mixed The content |
||
91 | */ |
||
92 | 68 | public function getContent() |
|
96 | } |
||
97 |