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 | * Full file mode. |
||
39 | * May include additional modes like setuid, guid, etc. |
||
40 | * |
||
41 | * @var int |
||
42 | */ |
||
43 | protected $mode; |
||
44 | |||
45 | /** |
||
46 | * @var int |
||
47 | */ |
||
48 | protected $size; |
||
49 | |||
50 | /** |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $linkTarget; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $blobId; |
||
59 | |||
60 | /** |
||
61 | * Prevent construction not using static factory methods. |
||
62 | */ |
||
63 | protected function __construct() {} |
||
64 | |||
65 | public function getRelativePath(): string |
||
69 | |||
70 | public function getBasename(): string |
||
76 | |||
77 | public function getType(): int |
||
81 | |||
82 | public function isDirectory(): bool |
||
86 | |||
87 | public function isFile(): bool |
||
91 | |||
92 | public function isLink(): bool |
||
96 | |||
97 | public function getMtime(): int |
||
101 | |||
102 | public function getCtime(): int |
||
106 | |||
107 | public function getMode(): int |
||
111 | |||
112 | public function getSize(): ?int |
||
116 | |||
117 | public function getLinkTarget(): ?string |
||
121 | |||
122 | public function getBlobId(): ?string |
||
126 | |||
127 | public function setBlobId(string $blobId): IndexObject |
||
133 | |||
134 | /** |
||
135 | * Equality check with all attributes. |
||
136 | * |
||
137 | * @param IndexObject $other |
||
138 | * @return bool |
||
139 | */ |
||
140 | public function equals(?IndexObject $other): bool |
||
159 | |||
160 | public function toScalarArray(): array |
||
173 | |||
174 | public static function fromScalarArray(array $array): IndexObject |
||
188 | |||
189 | /** |
||
190 | * Returns an instance representing the filesystem object that can be found under the given path. |
||
191 | * |
||
192 | * @param string $basePath |
||
193 | * @param string $relativePath |
||
194 | * @return IndexObject |
||
195 | */ |
||
196 | public static function fromPath(string $basePath, string $relativePath): IndexObject |
||
234 | } |
||
235 |