protected function determineDataSource()
{
if (!$this->_currentDataSourceValid) {
if (($dsid = $this->getDataSourceID()) !== '') {
if (($dataSource = $this->getNamingContainer()->findControl($dsid)) === null) {
throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent', $dsid);
} else {
if (!$dataSource instanceof IDataSource) {
throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid', $dsid);
} else {
$this->_currentDataSource = $dataSource;
}
}
} else {
if (($dataSource = $this->getDataSource()) !== null) {
$this->_currentDataSource = new TReadOnlyDataSource($dataSource, $this->getDataMember());
} else {
$this->_currentDataSource = null;
}
}
$this->_currentDataSourceValid = true;
}
return $this->_currentDataSource;
}