ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
ComponentEntryDescription.php
Go to the documentation of this file.
1
<?php
2
3
namespace
ILIAS\UI\Implementation\Crawler\Entry
;
4
12
class
ComponentEntryDescription
extends
AbstractEntryPart
implements
\JsonSerializable
13
{
17
protected
$description
=
array
(
18
"purpose"
=>
""
,
19
"composition"
=>
""
,
20
"effect"
=>
""
,
21
"rivals"
=>
array
()
22
);
23
28
public
function
__construct
(
$description
=
array
())
29
{
30
parent::__construct();
31
$this->
setDescription
(
$description
);
32
}
33
38
public
function
withDescription
(
$description
=
array
())
39
{
40
$clone = clone $this;
41
$clone->setDescription(
$description
);
42
return
$clone;
43
}
44
48
protected
function
setDescription
($descriptionElements)
49
{
50
if
(!$descriptionElements) {
51
return
;
52
}
53
$this->
assert
()->isArray($descriptionElements);
54
foreach
($descriptionElements as $category => $element) {
55
$this->
assert
()->isIndex($category, $this->description);
56
57
if
(is_array($this->description[$category])) {
58
if
($element && $element !=
""
) {
59
$this->
assert
()->isArray($element);
60
foreach
($element as
$key
=> $part) {
61
$this->
assert
()->isString($part);
62
$this->description[$category][
$key
] = $part;
63
}
64
}
65
}
else
{
66
$this->
assert
()->isString($element);
67
$this->description[$category] = $element;
68
}
69
}
70
}
71
75
public
function
getProperty
(
$key
)
76
{
77
$this->
assert
()->isIndex(
$key
, $this->description);
78
79
return
$this->description[
$key
];
80
}
81
85
public
function
getDescription
()
86
{
87
return
$this->description
;
88
}
89
93
public
function
jsonSerialize
()
94
{
95
return
$this->
getDescription
();
96
}
97
}
JsonSerializable
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\setDescription
setDescription($descriptionElements)
Definition:
ComponentEntryDescription.php:48
ILIAS\UI\Implementation\Crawler\Entry\AbstractEntryPart
Abstract Entry Part to share some common entry functionality.
Definition:
AbstractEntryPart.php:13
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\$description
$description
Definition:
ComponentEntryDescription.php:17
ILIAS\UI\Implementation\Crawler\Entry\AbstractEntryPart\assert
assert()
Definition:
AbstractEntryPart.php:31
ILIAS\UI\Implementation\Crawler\Entry
Definition:
AbstractEntryPart.php:4
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\jsonSerialize
jsonSerialize()
Definition:
ComponentEntryDescription.php:93
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\withDescription
withDescription($description=array())
Definition:
ComponentEntryDescription.php:38
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\getProperty
getProperty($key)
Definition:
ComponentEntryDescription.php:75
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\__construct
__construct($description=array())
ComponentEntryDescription constructor.
Definition:
ComponentEntryDescription.php:28
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\getDescription
getDescription()
Definition:
ComponentEntryDescription.php:85
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription
Container to hold description of UI Components.
Definition:
ComponentEntryDescription.php:12
$key
$key
Definition:
croninfo.php:18
src
UI
Implementation
Crawler
Entry
ComponentEntryDescription.php
Generated on Sat Jan 18 2025 19:01:43 for ILIAS by
1.8.13 (using
Doxyfile
)