1 | <?php |
||
10 | class IndexObject |
||
11 | { |
||
12 | const TYPE_DIR = 1; |
||
13 | const TYPE_FILE = 2; |
||
14 | const TYPE_LINK = 3; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $relativePath; |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | protected $type; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | protected $mtime; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | protected $ctime; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | protected $mode; |
||
40 | |||
41 | /** |
||
42 | * @var int |
||
43 | */ |
||
44 | protected $size; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $linkTarget; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $blobId; |
||
55 | |||
56 | /** |
||
57 | * Prevent construction not using static factory methods. |
||
58 | */ |
||
59 | protected function __construct() {} |
||
60 | |||
61 | public function getRelativePath(): string |
||
65 | |||
66 | public function getType(): int |
||
70 | |||
71 | public function isDirectory(): bool |
||
75 | |||
76 | public function isFile(): bool |
||
80 | |||
81 | public function isLink(): bool |
||
85 | |||
86 | public function getMtime(): int |
||
90 | |||
91 | public function getCtime(): int |
||
95 | |||
96 | public function getMode(): int |
||
100 | |||
101 | public function getSize(): ?int |
||
105 | |||
106 | public function getLinkTarget(): ?string |
||
110 | |||
111 | public function getBlobId(): ?string |
||
115 | |||
116 | public function setBlobId(string $blobId): IndexObject |
||
122 | |||
123 | public function toScalarArray(): array |
||
136 | |||
137 | public static function fromScalarArray(array $array): IndexObject |
||
151 | |||
152 | /** |
||
153 | * Returns an instance representing the filesystem object that can be found under the given path. |
||
154 | * |
||
155 | * @param string $basePath |
||
156 | * @param string $relativePath |
||
157 | * @return IndexObject |
||
158 | */ |
||
159 | public static function fromPath(string $basePath, string $relativePath): IndexObject |
||
197 | } |
||
198 |