1 | <?php |
||
24 | final class File implements FileInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $name; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $path; |
||
35 | |||
36 | /** |
||
37 | * @var string; |
||
38 | */ |
||
39 | private $rootPath; |
||
40 | |||
41 | /** |
||
42 | * @var string; |
||
43 | */ |
||
44 | private $relativePath; |
||
45 | |||
46 | /** |
||
47 | * @var integer |
||
48 | */ |
||
49 | private $size; |
||
50 | |||
51 | /** |
||
52 | * @var \DateTimeInterface |
||
53 | */ |
||
54 | private $createdAt; |
||
55 | |||
56 | /** |
||
57 | * @var \DateTimeInterface |
||
58 | */ |
||
59 | private $modifiedAt; |
||
60 | |||
61 | public function __construct($name, $path, $rootPath, $size, $createdAt, $modifiedAt) |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function getName() |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function getPath() |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function getRootPath() |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function getRelativePath() |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | public function getSize() |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function getCreatedAt() |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | public function getModifiedAt() |
||
135 | |||
136 | /** |
||
137 | * Create File instance from local, mounted filesystem. |
||
138 | * |
||
139 | * @param string $path Path to file. |
||
140 | * @param null|string $rootPath Root path of file. |
||
141 | * @param null|string $name Filename to use instead of original one (if provided). |
||
142 | * @return File Created backup file instance. |
||
143 | */ |
||
144 | public static function fromLocal($path, $rootPath = null, $name = null) |
||
155 | } |