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 | * @deprecated The third and fourth arguments are deprecated since version 1.2 and will be removed in 2.0. |
||
37 | */ |
||
38 | public function __construct($resource, ConfigurationInterface $configuration = null, $alias = null, $restore = false) |
||
39 | { |
||
40 | $this->resource = $resource; |
||
41 | $this->configuration = $configuration; |
||
42 | $this->alias = $alias; |
||
43 | $this->restore = $restore; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Creates a FileResource. |
||
48 | * |
||
49 | * @param string $resource |
||
50 | * @param ConfigurationInterface $configuration |
||
51 | * @param string $alias |
||
52 | * @param bool $restore |
||
53 | * |
||
54 | * @deprecated The third and fourth arguments are deprecated since version 1.2 and will be removed in 2.0. |
||
55 | * |
||
56 | * @return FileResource |
||
57 | */ |
||
58 | public static function create($resource, ConfigurationInterface $configuration = null, $alias = null, $restore = false) |
||
62 | |||
63 | /** |
||
64 | * Gets configuration. |
||
65 | * |
||
66 | * @return ConfigurationInterface |
||
67 | */ |
||
68 | 44 | public function getConfiguration() |
|
72 | |||
73 | /** |
||
74 | * Sets configuration. |
||
75 | * |
||
76 | * @param ConfigurationInterface $configuration |
||
77 | * |
||
78 | * @return FileResource |
||
79 | */ |
||
80 | 1 | public function setConfiguration(ConfigurationInterface $configuration) |
|
86 | |||
87 | /** |
||
88 | * Returns the resource tied to this Resource. |
||
89 | * |
||
90 | * @return mixed The resource |
||
91 | */ |
||
92 | 49 | public function getResource() |
|
96 | |||
97 | /** |
||
98 | * Sets the resource. |
||
99 | * |
||
100 | * @param string $resource |
||
101 | * |
||
102 | * @return FileResource |
||
103 | */ |
||
104 | 1 | public function setResource($resource) |
|
110 | |||
111 | /** |
||
112 | * Gets an alias (as ConfigCache service name suffix). |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | 18 | public function getAlias() |
|
120 | |||
121 | /** |
||
122 | * Sets an alias (as ConfigCache service name suffix). |
||
123 | * |
||
124 | * @param string $alias |
||
125 | * |
||
126 | * @return FileResource |
||
127 | * |
||
128 | * @throws \InvalidArgumentException |
||
129 | */ |
||
130 | 6 | public function setAlias($alias) |
|
139 | |||
140 | /** |
||
141 | * Whether FileResource has an alias or not. |
||
142 | * |
||
143 | * @return bool |
||
144 | */ |
||
145 | 32 | public function hasAlias() |
|
149 | |||
150 | /** |
||
151 | * Whether this resources is restorable or not. |
||
152 | * |
||
153 | * @return bool |
||
154 | */ |
||
155 | 16 | public function isRestorable() |
|
159 | |||
160 | /** |
||
161 | * Sets restorable. |
||
162 | * |
||
163 | * @param bool $restore |
||
164 | * |
||
165 | * @return FileResource |
||
166 | */ |
||
167 | 1 | public function setRestorable($restore) |
|
173 | |||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | */ |
||
177 | 26 | public function exists() |
|
181 | } |
||
182 |