Update Table.php

This commit is contained in:
Alessandro Ferro 2022-07-27 09:40:24 +02:00
parent fcc6c153e8
commit 12c171577d
1 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<?php
/**
* PhpXpress v1.0.1
* PhpXpress v1.0.2
*
* @see https://github.com/xfarrow/phpxpress The PhpXpress GitHub project
*
@ -11,7 +11,7 @@
* FITNESS FOR A PARTICULAR PURPOSE.
*/
namespace PhpXpress;
class Table{
/* === Structure === */
@ -150,8 +150,10 @@
* @return void
*/
function setDataSource(Array $dataSource){
if(empty($dataSource))
throw new InvalidArgumentException('Parameter cannot be empty.');
if(empty($dataSource)){
$this->dataSource = [];
return;
}
if(isset($this-> dataSource))
throw new BadFunctionCallException("Cannot add datasource to a Table already having a datasource");