ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
ComponentEntryRules.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\Implementation\Crawler\Entry
;
22
23
use
JsonSerializable
;
24
31
class
ComponentEntryRules
extends
AbstractEntryPart
implements
JsonSerializable
32
{
33
protected
array
$rules
= array(
34
"usage"
=> array(),
35
"composition"
=> array(),
36
"interaction"
=> array(),
37
"wording"
=> array(),
38
"ordering"
=> array(),
39
"style"
=> array(),
40
"responsiveness"
=> array(),
41
"accessibility"
=> array()
42
);
43
44
public
function
__construct
(array $rules = array())
45
{
46
parent::__construct
();
47
$this->
setRules
($rules);
48
}
49
50
public
function
withRules
(array $rules = array()):
ComponentEntryRules
51
{
52
$clone = clone $this;
53
$clone->
setRules
($rules);
54
return
$clone;
55
}
56
57
protected
function
setRules
(array $rules): void
58
{
59
if
(!$rules) {
60
return
;
61
}
62
63
foreach
($rules as $rule_category => $category_rules) {
64
$this->
assert
()->isIndex($rule_category, $this->rules);
65
if
($category_rules && $category_rules !=
""
) {
66
$this->
assert
()->isArray($category_rules);
67
foreach
($category_rules as $rule_id => $rule) {
68
$this->
assert
()->isString($rule);
69
$this->rules[$rule_category][$rule_id] = $rule;
70
}
71
}
72
}
73
}
74
75
public
function
getRules
(): array
76
{
77
return
$this->rules
;
78
}
79
80
public
function
hasRules
(): bool
81
{
82
foreach
($this->rules as $category_rules) {
83
if
(
sizeof
($category_rules)) {
84
return
true
;
85
}
86
}
87
return
false
;
88
}
89
90
public
function
jsonSerialize
(): array
91
{
92
return
$this->
getRules
();
93
}
94
}
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryRules
Container to hold rules of UI Components.
Definition:
ComponentEntryRules.php:31
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryRules\jsonSerialize
jsonSerialize()
Definition:
ComponentEntryRules.php:90
ILIAS\UI\Implementation\Crawler\Entry\AbstractEntryPart
Abstract Entry Part to share some common entry functionality.
Definition:
AbstractEntryPart.php:30
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryRules\setRules
setRules(array $rules)
Definition:
ComponentEntryRules.php:57
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryRules\withRules
withRules(array $rules=array())
Definition:
ComponentEntryRules.php:50
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryRules\getRules
getRules()
Definition:
ComponentEntryRules.php:75
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryRules\__construct
__construct(array $rules=array())
Definition:
ComponentEntryRules.php:44
ILIAS\UI\Implementation\Crawler\Entry\AbstractEntryPart\assert
assert()
Definition:
AbstractEntryPart.php:39
ILIAS\UI\Implementation\Crawler\Entry
Definition:
AbstractEntryPart.php:21
JsonSerializable
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryRules\$rules
array $rules
Definition:
ComponentEntryRules.php:33
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
Definition:
PluginProviderHelper.php:37
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntryRules\hasRules
hasRules()
Definition:
ComponentEntryRules.php:80
components
ILIAS
UI
src
Implementation
Crawler
Entry
ComponentEntryRules.php
Generated on Sun Aug 31 2025 23:04:11 for ILIAS by
1.8.13 (using
Doxyfile
)