ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Listing.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2016 Timon Amstutz <timon.amstutz@ilub.unibe.ch> Extended GPL, see docs/LICENSE */
4
6
9
14class Listing implements C\Listing\Listing
15{
17
21 private $items;
22
23
28 public function __construct($items)
29 {
30 $types = array('string',C\Component::class);
31 $this->checkArgListElements("items", $items, $types);
32 $this->items = $items;
33 }
34
38 public function withItems(array $items)
39 {
40 $types = array('string',C\Component::class);
41 $this->checkArgListElements("items", $items, $types);
42
43 $clone = clone $this;
44 $clone->items = $items;
45 return $clone;
46 }
47
51 public function getItems()
52 {
53 return $this->items;
54 }
55}
An exception for terminatinating execution or to throw for unit testing.
__construct($items)
Listing constructor.
Definition: Listing.php:28
checkArgListElements($which, array &$values, &$classes)
Check every element of the list if it is an instance of one of the given classes.
trait ComponentHelper
Provides common functionality for component implementations.