1 | <?php |
||
21 | class FileResource implements ResourceInterface |
||
22 | { |
||
23 | protected $resource; |
||
24 | protected $configuration; |
||
25 | protected $alias; |
||
26 | protected $restore; |
||
27 | |||
28 | /** |
||
29 | * Constructor. |
||
30 | * |
||
31 | * @param string $resource |
||
32 | * @param ConfigurationInterface $configuration |
||
33 | * @param string $alias |
||
34 | * @param bool $restore |
||
35 | */ |
||
36 | 49 | public function __construct($resource, ConfigurationInterface $configuration = null, $alias = null, $restore = false) |
|
43 | |||
44 | /** |
||
45 | * Creates a FileResource. |
||
46 | * |
||
47 | * @param string $resource |
||
48 | * @param ConfigurationInterface $configuration |
||
49 | * @param string $alias |
||
50 | * @param bool $restore |
||
51 | * |
||
52 | * @return FileResource |
||
53 | */ |
||
54 | 1 | public static function create($resource, ConfigurationInterface $configuration = null, $alias = null, $restore = false) |
|
58 | |||
59 | /** |
||
60 | * Gets configuration. |
||
61 | * |
||
62 | * @return ConfigurationInterface |
||
63 | */ |
||
64 | 44 | public function getConfiguration() |
|
68 | |||
69 | /** |
||
70 | * Sets configuration. |
||
71 | * |
||
72 | * @param ConfigurationInterface $configuration |
||
73 | * |
||
74 | * @return FileResource |
||
75 | */ |
||
76 | 1 | public function setConfiguration(ConfigurationInterface $configuration) |
|
82 | |||
83 | /** |
||
84 | * Returns the resource tied to this Resource. |
||
85 | * |
||
86 | * @return mixed The resource |
||
87 | */ |
||
88 | 49 | public function getResource() |
|
92 | |||
93 | /** |
||
94 | * Sets the resource. |
||
95 | * |
||
96 | * @param string $resource |
||
97 | * |
||
98 | * @return FileResource |
||
99 | */ |
||
100 | 1 | public function setResource($resource) |
|
106 | |||
107 | /** |
||
108 | * Gets an alias (as ConfigCache service name suffix). |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | 18 | public function getAlias() |
|
116 | |||
117 | /** |
||
118 | * Sets an alias (as ConfigCache service name suffix). |
||
119 | * |
||
120 | * @param string $alias |
||
121 | * |
||
122 | * @return FileResource |
||
123 | * |
||
124 | * @throws \InvalidArgumentException |
||
125 | */ |
||
126 | 6 | public function setAlias($alias) |
|
135 | |||
136 | /** |
||
137 | * Whether FileResource has an alias or not. |
||
138 | * |
||
139 | * @return bool |
||
140 | */ |
||
141 | 32 | public function hasAlias() |
|
145 | |||
146 | /** |
||
147 | * Whether this resources is restorable or not. |
||
148 | * |
||
149 | * @return bool |
||
150 | */ |
||
151 | 16 | public function isRestorable() |
|
155 | |||
156 | /** |
||
157 | * Sets restorable. |
||
158 | * |
||
159 | * @param bool $restore |
||
160 | * |
||
161 | * @return FileResource |
||
162 | */ |
||
163 | 1 | public function setRestorable($restore) |
|
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | */ |
||
173 | 26 | public function exists() |
|
177 | } |
||
178 |