1 | <?php |
||
5 | class Loop { |
||
6 | |||
7 | private $block = null, $items = null; |
||
8 | |||
9 | /** |
||
10 | * Constructor |
||
11 | */ |
||
12 | |||
13 | public function __construct(string $contents = '') { |
||
17 | |||
18 | /** |
||
19 | * Add an item |
||
20 | * |
||
21 | * @return the current loop object |
||
22 | */ |
||
23 | |||
24 | public function addItem(array $data) : Loop { |
||
30 | |||
31 | /** |
||
32 | * Add multiple items |
||
33 | * |
||
34 | * @return the current loop object |
||
35 | */ |
||
36 | |||
37 | public function addItems(array $items) : Loop { |
||
43 | |||
44 | /** |
||
45 | * Clear the items list |
||
46 | * |
||
47 | * @return the current loop object |
||
48 | */ |
||
49 | |||
50 | public function removeItems() : Loop { |
||
56 | |||
57 | /** |
||
58 | * Set items list |
||
59 | * |
||
60 | * @return the current loop object |
||
61 | */ |
||
62 | |||
63 | public function setItems(array $items) : Loop { |
||
69 | |||
70 | /** |
||
71 | * Get the items list |
||
72 | */ |
||
73 | |||
74 | public function getItems() : array { |
||
78 | |||
79 | /** |
||
80 | * Get the items count |
||
81 | */ |
||
82 | |||
83 | public function getCount() : int { |
||
87 | |||
88 | /** |
||
89 | * Get the loop contents |
||
90 | */ |
||
91 | |||
92 | public function getContents() : string { |
||
96 | |||
97 | /** |
||
98 | * Cloner |
||
99 | */ |
||
100 | |||
101 | public function __clone() { |
||
105 | } |
||
106 | } |
||
107 |