Skip to content

Commit

Permalink
fix some issue about string or object data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehedi Hasan Nahid committed May 22, 2017
1 parent eaa328c commit ff3ad61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/JsonManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ public function makeUniqueName($prefix='jsonq', $hash=false)

protected function processConditions()
{
$data = $this->getData();
if (is_string($data)) {
return $data;
}
if (!$this->isMultiArray($data)) {
return $data;
}
$andData = $this->fetchAndData();
$orData = $this->fetchOrData();
//var_dump($andData);
Expand Down
7 changes: 7 additions & 0 deletions src/Jsonq.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ public function get($object = true)
//if (count(@$_andConditions)>0 or count(@$_orConditions)>0) {
$calculatedData = $this->processConditions();

if (is_string($calculatedData)) {
return $calculatedData;
}

if (!$this->isMultiArray($calculatedData)) {
return $calculatedData;
}
$resultingData = [];

foreach ($calculatedData as $data) {
Expand Down

0 comments on commit ff3ad61

Please sign in to comment.