Prado\Web\UI\WebControls\TDataBoundControl::getDataSourceView PHP Method

getDataSourceView() protected method

protected getDataSourceView ( )
    protected function getDataSourceView()
    {
        if (!$this->_currentViewValid) {
            if ($this->_currentView && $this->_currentViewIsFromDataSourceID) {
                $this->_currentView->detachEventHandler('DataSourceViewChanged', array($this, 'dataSourceViewChanged'));
            }
            if (($dataSource = $this->determineDataSource()) !== null) {
                if (($view = $dataSource->getView($this->getDataMember())) === null) {
                    throw new TInvalidDataValueException('databoundcontrol_datamember_invalid', $this->getDataMember());
                }
                if ($this->_currentViewIsFromDataSourceID = $this->getUsingDataSourceID()) {
                    $view->attachEventHandler('OnDataSourceViewChanged', array($this, 'dataSourceViewChanged'));
                }
                $this->_currentView = $view;
            } else {
                $this->_currentView = null;
            }
            $this->_currentViewValid = true;
        }
        return $this->_currentView;
    }