1 | <?php |
||
12 | class Loop { |
||
13 | |||
14 | private $block = null, $items = null; |
||
15 | |||
16 | /** |
||
17 | * Constructor |
||
18 | */ |
||
19 | |||
20 | public function __construct(string $contents = '') { |
||
24 | |||
25 | /** |
||
26 | * Cloner |
||
27 | */ |
||
28 | |||
29 | public function __clone() { |
||
33 | |||
34 | /** |
||
35 | * Add an item |
||
36 | * |
||
37 | * @return Template\Loop : the current loop object |
||
38 | */ |
||
39 | |||
40 | public function addItem(array $data) : Loop { |
||
46 | |||
47 | /** |
||
48 | * Add multiple items |
||
49 | * |
||
50 | * @return Template\Loop : the current loop object |
||
51 | */ |
||
52 | |||
53 | public function addItems(array $items) : Loop { |
||
59 | |||
60 | /** |
||
61 | * Clear the items list |
||
62 | * |
||
63 | * @return Template\Loop : the current loop object |
||
64 | */ |
||
65 | |||
66 | public function removeItems() : Loop { |
||
72 | |||
73 | /** |
||
74 | * Set items list |
||
75 | * |
||
76 | * @return Template\Loop : the current loop object |
||
77 | */ |
||
78 | |||
79 | public function setItems(array $items) : Loop { |
||
85 | |||
86 | /** |
||
87 | * Get the items list |
||
88 | */ |
||
89 | |||
90 | public function getItems() : array { |
||
94 | |||
95 | /** |
||
96 | * Get the items count |
||
97 | */ |
||
98 | |||
99 | public function getCount() : int { |
||
103 | |||
104 | /** |
||
105 | * Get the loop contents |
||
106 | */ |
||
107 | |||
108 | public function getContents() : string { |
||
112 | } |
||
113 | } |
||
114 |