ILIAS  release_8 Revision v8.24
AbstractCollection.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Iterator;
24
29abstract class AbstractCollection
30{
34 protected array $items = [];
35
36 protected string $resource_version;
37
41 public function __construct(string $resource_version)
42 {
43 $this->resource_version = $resource_version;
44 }
45
46 public function clear(): void
47 {
48 $this->items = [];
49 }
50
54 public function getItems(): Iterator
55 {
56 yield from $this->items;
57 }
58
62 public function getItemsInOrderOfDelivery(): array
63 {
64 return $this->items;
65 }
66
71 protected function stripPath(string $path): string
72 {
73 if (strpos($path, '?') !== false) {
74 return parse_url($path, PHP_URL_PATH);
75 }
76
77 return $path;
78 }
79}
$path
Definition: ltiservices.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...