ILIAS
trunk Revision v11.0_alpha-1769-g99a433fe2dc
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
Metadata.php
Go to the documentation of this file.
1
<?php
18
declare(strict_types=1);
19
20
namespace
ILIAS\Filesystem\DTO
;
21
22
use
ILIAS\Filesystem\MetadataType
;
23
31
final
class
Metadata
32
{
33
private
string
$type
;
34
50
public
function
__construct
(
private
string
$path
,
string
$type)
51
{
52
if
($type !==
MetadataType::FILE
&& $type !==
MetadataType::DIRECTORY
) {
53
throw
new \InvalidArgumentException(
"The metadata type must be FILE or DIRECTORY but \"$type\" was given."
);
54
}
55
$this->type =
$type
;
56
}
57
62
public
function
getPath
(): string
63
{
64
return
$this->path
;
65
}
66
76
public
function
getType
(): string
77
{
78
return
$this->type
;
79
}
80
85
public
function
isDir
(): bool
86
{
87
return
(strcmp($this->
getType
(),
MetadataType::DIRECTORY
) === 0);
88
}
89
94
public
function
isFile
(): bool
95
{
96
return
(strcmp($this->
getType
(),
MetadataType::FILE
) === 0);
97
}
98
}
ILIAS\Filesystem\DTO\Metadata\getType
getType()
The type of the subject which can be FILE or DIRECTORY.
Definition:
Metadata.php:76
ILIAS\Filesystem\DTO\Metadata\__construct
__construct(private string $path, string $type)
Metadata constructor.
Definition:
Metadata.php:50
ILIAS\Filesystem\DTO\Metadata\getPath
getPath()
The path to the file or directory.
Definition:
Metadata.php:62
ILIAS\Filesystem\MetadataType\FILE
const FILE
The subject is file.
Definition:
MetadataType.php:34
$path
$path
Definition:
ltiservices.php:29
ILIAS\Filesystem\DTO\Metadata\$type
string $type
Definition:
Metadata.php:33
ILIAS\Filesystem\DTO\Metadata\isDir
isDir()
The path is a directory.
Definition:
Metadata.php:85
ILIAS\Filesystem\DTO\Metadata\isFile
isFile()
The path is a file.
Definition:
Metadata.php:94
ILIAS\Filesystem\MetadataType\DIRECTORY
const DIRECTORY
The subject is a directory.
Definition:
MetadataType.php:38
ILIAS\Filesystem\DTO
Definition:
Metadata.php:20
ServicesInterface
MetadataType
components
ILIAS
Filesystem
src
DTO
Metadata.php
Generated on Sun Apr 13 2025 23:02:57 for ILIAS by
1.8.13 (using
Doxyfile
)