Prado\Web\UI\WebControls\TDataSourceView::__construct PHP Method

__construct() public method

public __construct ( Prado\Web\UI\WebControls\IDataSource $owner, $viewName )
$owner Prado\Web\UI\WebControls\IDataSource
    public function __construct(IDataSource $owner, $viewName)
    {
        $this->_owner = $owner;
        $this->_name = $viewName;
    }

Usage Example

 public function __construct(IDataSource $owner, $viewName, $dataSource)
 {
     parent::__construct($owner, $viewName);
     if ($dataSource === null || is_array($dataSource)) {
         $this->_dataSource = new TMap($dataSource);
     } else {
         if ($dataSource instanceof \Traversable) {
             $this->_dataSource = $dataSource;
         } else {
             throw new TInvalidDataTypeException('readonlydatasourceview_datasource_invalid');
         }
     }
 }