ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ 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
parent::__construct();
30
$this->
setDescription
(
$description
);
31
}
32
37
public
function
withDescription
(
$description
=
array
()){
38
$clone = clone $this;
39
$clone->setDescription(
$description
);
40
return
$clone;
41
}
42
46
protected
function
setDescription
($descriptionElements)
47
{
48
if
(!$descriptionElements){
49
return
;
50
}
51
$this->
assert
()->isArray($descriptionElements);
52
foreach
($descriptionElements as $category => $element){
53
$this->
assert
()->isIndex($category, $this->description);
54
55
if
(is_array($this->description[$category])){
56
if
($element && $element !=
""
) {
57
$this->
assert
()->isArray($element);
58
foreach
($element as $key => $part) {
59
$this->
assert
()->isString($part);
60
$this->description[$category][$key] = $part;
61
}
62
}
63
}
else
{
64
$this->
assert
()->isString($element);
65
$this->description[$category] = $element;
66
}
67
68
}
69
}
70
74
public
function
getProperty
($key){
75
$this->
assert
()->isIndex($key, $this->description);
76
77
return
$this->description[$key];
78
}
79
83
public
function
getDescription
(){
84
return
$this->description
;
85
}
86
90
public
function
jsonSerialize
() {
91
return
$this->
getDescription
();
92
}
93
}
JsonSerializable
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\setDescription
setDescription($descriptionElements)
Definition:
ComponentEntryDescription.php:46
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:30
ILIAS\UI\Implementation\Crawler\Entry
Definition:
AbstractEntryPart.php:4
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\jsonSerialize
jsonSerialize()
Definition:
ComponentEntryDescription.php:90
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription\withDescription
withDescription($description=array())
Definition:
ComponentEntryDescription.php:37
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:74
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:83
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryDescription
Container to hold description of UI Components.
Definition:
ComponentEntryDescription.php:12
php
src
UI
Implementation
Crawler
Entry
ComponentEntryDescription.php
Generated on Fri Jan 17 2025 19:01:21 for ILIAS by
1.8.13 (using
Doxyfile
)