Update Table.php

This commit is contained in:
Alessandro Ferro 2022-07-27 11:59:18 +02:00
parent 12c171577d
commit 7b481afe26
1 changed files with 4 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/** /**
* PhpXpress v1.0.2 * PhpXpress v1.0.3
* *
* @see https://github.com/xfarrow/phpxpress The PhpXpress GitHub project * @see https://github.com/xfarrow/phpxpress The PhpXpress GitHub project
* *
@ -150,15 +150,14 @@
* @return void * @return void
*/ */
function setDataSource(Array $dataSource){ function setDataSource(Array $dataSource){
if(isset($this-> dataSource))
throw new BadFunctionCallException("Cannot add datasource to a Table already having a datasource");
if(empty($dataSource)){ if(empty($dataSource)){
$this->dataSource = []; $this->dataSource = [];
return; return;
} }
if(isset($this-> dataSource))
throw new BadFunctionCallException("Cannot add datasource to a Table already having a datasource");
$is_array_of_arrays; // if false, the datasource is an array of object(s) $is_array_of_arrays; // if false, the datasource is an array of object(s)
if(is_object($dataSource[0])){ if(is_object($dataSource[0])){
$is_array_of_arrays = false; $is_array_of_arrays = false;