From 7b481afe263412f0893d83c244356972864c5a04 Mon Sep 17 00:00:00 2001 From: Alessandro Ferro <49845537+xfarrow@users.noreply.github.com> Date: Wed, 27 Jul 2022 11:59:18 +0200 Subject: [PATCH] Update Table.php --- phpxpress/Table.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/phpxpress/Table.php b/phpxpress/Table.php index 4ba86da..26d8147 100644 --- a/phpxpress/Table.php +++ b/phpxpress/Table.php @@ -1,7 +1,7 @@ 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;