getItemClass(); $i = 0; foreach ($this->data as $data) { $item = new $itemClass($data, $this); $item->setOrder($i++); $this->add($item); } if ($this->isEmpty()) { $this->setTag('div'); $this->add(new EmptyState(t('No items found.'))); } } }