Prado\Web\UI\WebControls\TRepeater::restoreItemsFromViewState PHP Method

restoreItemsFromViewState() protected method

Creates repeater items based on viewstate information.
    protected function restoreItemsFromViewState()
    {
        $this->reset();
        if (($itemCount = $this->getViewState('ItemCount', 0)) > 0) {
            $items = $this->getItems();
            $hasSeparator = $this->_separatorTemplate !== null || $this->getSeparatorRenderer() !== '';
            $this->_header = $this->createItemInternal(-1, TListItemType::Header);
            for ($i = 0; $i < $itemCount; ++$i) {
                if ($hasSeparator && $i > 0) {
                    $this->createItemInternal($i - 1, TListItemType::Separator);
                }
                $itemType = $i % 2 == 0 ? TListItemType::Item : TListItemType::AlternatingItem;
                $items->add($this->createItemInternal($i, $itemType, false, null));
            }
            $this->_footer = $this->createItemInternal(-1, TListItemType::Footer);
        } else {
            $this->createEmptyContent();
        }
        $this->clearChildState();
    }