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 int |
||
52 | */ |
||
53 | protected $inode; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $linkTarget; |
||
59 | |||
60 | /** |
||
61 | * Content hashes for file index objects. |
||
62 | * |
||
63 | * @var HashContainer |
||
64 | */ |
||
65 | protected $hashes; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $blobId; |
||
71 | |||
72 | public function __construct(string $relativePath, int $type, int $mtime, int $ctime, int $mode, ?int $size, ?int $inode, ?string $linkTarget, ?string $blobId, ?HashContainer $hashContainer) |
||
90 | |||
91 | public function getRelativePath(): string |
||
95 | |||
96 | public function getBasename(): string |
||
102 | |||
103 | public function getType(): int |
||
107 | |||
108 | public function isDirectory(): bool |
||
112 | |||
113 | public function isFile(): bool |
||
117 | |||
118 | public function isLink(): bool |
||
122 | |||
123 | public function getMtime(): int |
||
127 | |||
128 | public function getCtime(): int |
||
132 | |||
133 | public function getMode(): int |
||
137 | |||
138 | public function getSize(): ?int |
||
142 | |||
143 | public function getInode(): ?int |
||
147 | |||
148 | public function getLinkTarget(): ?string |
||
152 | |||
153 | public function getHashes(): ?HashContainer |
||
157 | |||
158 | public function getBlobId(): ?string |
||
162 | |||
163 | public function setBlobId(string $blobId): IndexObject |
||
169 | |||
170 | /** |
||
171 | * Equality check with all attributes. |
||
172 | * |
||
173 | * @param IndexObject $other |
||
174 | * @return bool |
||
175 | */ |
||
176 | public function equals(?IndexObject $other): bool |
||
201 | } |
||
202 |