We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4a7411 commit 09afc04Copy full SHA for 09afc04
src/Common/BaseItemList.php
@@ -62,12 +62,24 @@ protected function init(): void
62
{
63
}
64
65
+ /**
66
+ * Create a list item for the given data
67
+ *
68
+ * @param object $data
69
70
+ * @return BaseListItem|BaseTableRowItem
71
+ */
72
+ protected function createListItem(object $data)
73
+ {
74
+ $className = $this->getItemClass();
75
+
76
+ return new $className($data, $this);
77
+ }
78
79
protected function assemble(): void
80
- $itemClass = $this->getItemClass();
81
foreach ($this->data as $data) {
- /** @var BaseListItem|BaseTableRowItem $item */
- $item = new $itemClass($data, $this);
82
+ $item = $this->createListItem($data);
83
$this->emit(self::BEFORE_ITEM_ADD, [$item, $data]);
84
$this->addHtml($item);
85
$this->emit(self::ON_ITEM_ADD, [$item, $data]);
0 commit comments