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 getBasename(): string |
||
73 | |||
74 | public function getType(): int |
||
78 | |||
79 | public function isDirectory(): bool |
||
83 | |||
84 | public function isFile(): bool |
||
88 | |||
89 | public function isLink(): bool |
||
93 | |||
94 | public function getMtime(): int |
||
98 | |||
99 | public function getCtime(): int |
||
103 | |||
104 | public function getMode(): int |
||
108 | |||
109 | public function getSize(): ?int |
||
113 | |||
114 | public function getLinkTarget(): ?string |
||
118 | |||
119 | public function getBlobId(): ?string |
||
123 | |||
124 | public function setBlobId(string $blobId): IndexObject |
||
130 | |||
131 | /** |
||
132 | * Equality check with all attributes. |
||
133 | * |
||
134 | * @param IndexObject $other |
||
135 | * @return bool |
||
136 | */ |
||
137 | public function equals(?IndexObject $other): bool |
||
149 | |||
150 | /** |
||
151 | * Comparison without blobId. |
||
152 | * |
||
153 | * @param IndexObject $other |
||
154 | * @return bool |
||
155 | */ |
||
156 | public function equalsOnDisk(?IndexObject $other): bool |
||
174 | |||
175 | public function toScalarArray(): array |
||
188 | |||
189 | public static function fromScalarArray(array $array): IndexObject |
||
203 | |||
204 | /** |
||
205 | * Returns an instance representing the filesystem object that can be found under the given path. |
||
206 | * |
||
207 | * @param string $basePath |
||
208 | * @param string $relativePath |
||
209 | * @return IndexObject |
||
210 | */ |
||
211 | public static function fromPath(string $basePath, string $relativePath): IndexObject |
||
249 | } |
||
250 |