ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
Metadata.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Filesystem\DTO
;
22
23
use
ILIAS\Filesystem\MetadataType
;
24
32
final
class
Metadata
33
{
34
private
string
$type
;
35
51
public
function
__construct
(
private
string
$path
,
string
$type
)
52
{
53
if
(
$type
!==
MetadataType::FILE
&&
$type
!==
MetadataType::DIRECTORY
) {
54
throw
new \InvalidArgumentException(
"The metadata type must be FILE or DIRECTORY but \"$type\" was given."
);
55
}
56
$this->type =
$type
;
57
}
58
63
public
function
getPath
(): string
64
{
65
return
$this->path
;
66
}
67
77
public
function
getType
(): string
78
{
79
return
$this->type
;
80
}
81
86
public
function
isDir
(): bool
87
{
88
return
(strcmp($this->
getType
(),
MetadataType::DIRECTORY
) === 0);
89
}
90
95
public
function
isFile
(): bool
96
{
97
return
(strcmp($this->
getType
(),
MetadataType::FILE
) === 0);
98
}
99
}
ILIAS\Filesystem\DTO\Metadata
This class holds all default metadata send by the filesystem adapters.
Definition:
Metadata.php:33
ILIAS\Filesystem\DTO\Metadata\getPath
getPath()
The path to the file or directory.
Definition:
Metadata.php:63
ILIAS\Filesystem\DTO\Metadata\__construct
__construct(private string $path, string $type)
Metadata constructor.
Definition:
Metadata.php:51
ILIAS\Filesystem\DTO\Metadata\$type
string $type
Definition:
Metadata.php:34
ILIAS\Filesystem\DTO\Metadata\isFile
isFile()
The path is a file.
Definition:
Metadata.php:95
ILIAS\Filesystem\DTO\Metadata\isDir
isDir()
The path is a directory.
Definition:
Metadata.php:86
ILIAS\Filesystem\DTO\Metadata\getType
getType()
The type of the subject which can be FILE or DIRECTORY.
Definition:
Metadata.php:77
ILIAS\Filesystem\MetadataType
The possible metadata types of the filesystem metadata.
Definition:
MetadataType.php:31
ILIAS\Filesystem\MetadataType\FILE
const FILE
The subject is file.
Definition:
MetadataType.php:35
ILIAS\Filesystem\MetadataType\DIRECTORY
const DIRECTORY
The subject is a directory.
Definition:
MetadataType.php:39
$path
$path
Definition:
ltiservices.php:30
ILIAS\Filesystem\DTO
Definition:
Metadata.php:21
components
ILIAS
Filesystem
src
DTO
Metadata.php
Generated on Sat Oct 18 2025 23:03:04 for ILIAS by
1.9.4 (using
Doxyfile
)