1 | <?php |
||
10 | class IndexObject |
||
11 | { |
||
12 | public const TYPE_DIR = 1; |
||
13 | public const TYPE_FILE = 2; |
||
14 | public const TYPE_LINK = 3; |
||
15 | |||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $relativePath; |
||
21 | |||
22 | /** |
||
23 | * @var int |
||
24 | */ |
||
25 | protected $type; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | protected $mtime; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | protected $ctime; |
||
36 | |||
37 | /** |
||
38 | * @var int |
||
39 | */ |
||
40 | protected $mode; |
||
41 | |||
42 | /** |
||
43 | * @var int |
||
44 | */ |
||
45 | protected $size; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $linkTarget; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $blobId; |
||
56 | |||
57 | /** |
||
58 | * Prevent construction not using static factory methods. |
||
59 | */ |
||
60 | protected function __construct() {} |
||
61 | |||
62 | public function getRelativePath(): string |
||
66 | |||
67 | public function getType(): int |
||
71 | |||
72 | public function isDirectory(): bool |
||
76 | |||
77 | public function isFile(): bool |
||
81 | |||
82 | public function isLink(): bool |
||
86 | |||
87 | public function getMtime(): int |
||
91 | |||
92 | public function getCtime(): int |
||
96 | |||
97 | public function getMode(): int |
||
101 | |||
102 | public function getSize(): ?int |
||
106 | |||
107 | public function getLinkTarget(): ?string |
||
111 | |||
112 | public function getBlobId(): ?string |
||
116 | |||
117 | public function setBlobId(string $blobId): IndexObject |
||
123 | |||
124 | /** |
||
125 | * Equality check with all attributes. |
||
126 | * |
||
127 | * @param IndexObject $other |
||
128 | * @return bool |
||
129 | */ |
||
130 | public function equals(?IndexObject $other): bool |
||
142 | |||
143 | /** |
||
144 | * Comparison without blobId. |
||
145 | * |
||
146 | * @param IndexObject $other |
||
147 | * @return bool |
||
148 | */ |
||
149 | public function equalsOnDisk(?IndexObject $other): bool |
||
167 | |||
168 | public function toScalarArray(): array |
||
181 | |||
182 | public static function fromScalarArray(array $array): IndexObject |
||
196 | |||
197 | /** |
||
198 | * Returns an instance representing the filesystem object that can be found under the given path. |
||
199 | * |
||
200 | * @param string $basePath |
||
201 | * @param string $relativePath |
||
202 | * @return IndexObject |
||
203 | */ |
||
204 | public static function fromPath(string $basePath, string $relativePath): IndexObject |
||
242 | } |
||
243 |