Prado\Web\UI\WebControls\TListControl::addParsedObject PHP Method

addParsedObject() public method

This method adds only {@link TListItem} objects into the {@link getItems Items} collection. All other objects are ignored.
public addParsedObject ( $object )
    public function addParsedObject($object)
    {
        // Do not add items from template if items are loaded from viewstate
        if (!$this->_stateLoaded && $object instanceof TListItem) {
            $index = $this->getItems()->add($object);
            if ($this->_cachedSelectedValue !== null && $this->_cachedSelectedValue === $object->getValue() || $this->_cachedSelectedIndex === $index) {
                $object->setSelected(true);
                $this->_cachedSelectedValue = null;
                $this->_cachedSelectedIndex = -1;
            }
        }
    }