Debian Codegraph @

vendor/ipl/web/src/Common/BaseOrderedItemList.php

raw
1 <?php
2
3 namespace ipl\Web\Common;
4
5 use ipl\Web\Widget\EmptyStateBar;
6
7 /**
8 * @method BaseOrderedListItem getItemClass()
9 * @deprecated Use your own implementation instead
10 */
11 abstract class BaseOrderedItemList extends BaseItemList
12 {
13 protected $tag = 'ol';
14
15 protected function assemble(): void
16 {
17 $itemClass = $this->getItemClass();
18
19 $i = 0;
20 foreach ($this->data as $data) {
21 $item = new $itemClass($data, $this);
22 $item->setOrder($i++);
23
24 $this->addHtml($item);
25 }
26
27 if ($this->isEmpty()) {
28 $this->setTag('div');
29 $this->addHtml(new EmptyStateBar(t('No items found.')));
30 }
31 }
32 }