ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
7 use ILIAS\UI\Component as C;
9 
14 class Listing implements C\Listing\Listing
15 {
16  use ComponentHelper;
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 }
__construct($items)
Listing constructor.
Definition: Listing.php:28
trait ComponentHelper
Provides common functionality for component implementations.
checkArgListElements($which, array &$values, &$classes)
Check every element of the list if it is an instance of one of the given classes. ...