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