ILIAS
trunk Revision v11.0_alpha-1723-g8e69f309bab
◀ 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
JsCollection.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media
;
22
26
class
JsCollection
extends
AbstractCollection
27
{
28
protected
array
$path_storage
= [];
29
30
31
public
function
addItem
(
Js
$item): void
32
{
33
$basename = $this->
stripPath
($item->
getContent
());
34
if
(!array_key_exists($basename, $this->items)) {
35
$this->
storeItem
($item);
36
}
else
{
37
$existing = $this->items[$basename];
38
if
(($existing instanceof
Js
) && $existing->getBatch() > $item->
getBatch
()) {
39
$this->
storeItem
($item);
40
}
41
}
42
}
43
44
private
function
storeItem
(
45
js $item
46
): void {
47
$strip_path = $this->
stripPath
($item->getContent());
48
$this->items[$strip_path] = $item;
49
$this->path_storage[$strip_path] = $item->getBatch();
50
}
51
52
#[\Override]
53
public
function
getItemsInOrderOfDelivery
(): array
54
{
55
$ordered = [];
56
foreach
($this->
getItems
() as
$js
) {
57
$ordered[
'pos_'
. (string) $js->getBatch()][] =
$js
;
58
}
59
ksort($ordered);
60
$ordered_all = [];
61
foreach
($ordered as $item) {
62
foreach
($item as $js) {
63
$ordered_all[] =
$js
;
64
}
65
}
66
67
return
$ordered_all;
68
}
69
}
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\JsCollection\addItem
addItem(Js $item)
Definition:
JsCollection.php:31
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\JsCollection\$path_storage
array $path_storage
Definition:
JsCollection.php:28
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractCollection
Definition:
AbstractCollection.php:29
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\Js
Definition:
Js.php:26
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\JsCollection
Definition:
JsCollection.php:26
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\Js\getBatch
getBatch()
Definition:
Js.php:44
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractCollection\stripPath
stripPath(string $path)
Definition:
AbstractCollection.php:146
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\JsCollection\getItemsInOrderOfDelivery
getItemsInOrderOfDelivery()
Definition:
JsCollection.php:53
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractCollection\getItems
getItems()
Definition:
AbstractCollection.php:84
ILIAS\GlobalScreen\Scope\Layout\MetaContent\MetaContent\$js
JsCollection $js
Definition:
MetaContent.php:47
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\JsCollection\storeItem
storeItem(js $item)
Definition:
JsCollection.php:44
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media
Definition:
AbstractCollection.php:21
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMedia\getContent
getContent()
Definition:
AbstractMedia.php:32
components
ILIAS
GlobalScreen
src
Scope
Layout
MetaContent
Media
JsCollection.php
Generated on Sun Apr 6 2025 23:03:21 for ILIAS by
1.8.13 (using
Doxyfile
)