Skip to content

Commit

Permalink
Fixed talking queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
ozanuykun committed May 1, 2018
1 parent 92f0b95 commit a41ae69
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions Internal/package-database/CallableTalkingQueries.php
Expand Up @@ -165,6 +165,7 @@ protected function callWhereHavingTalkingQuery($split, $parameters)
}

/**
* updated[5.7.0.1]
* Protected call result methods talking query
*/
protected function callResultMethodsTalkingQuery($method, $split, $parameters)
Expand All @@ -178,12 +179,25 @@ protected function callResultMethodsTalkingQuery($method, $split, $parameters)
$result = strtolower($func);
}

$whereClause = $parameters[0] ?? ($result === 'row' ? 0 : 'object');

# Value
if( $select = ($split[2] ?? NULL) )
{
$result = 'value';
if( isset($parameters[0]) )
{
$this->where(strtolower($split[2]), $parameters[0]);

$whereClause = 0;
}
else
{
$result = 'value';

$this->select($select);

$this->select($select);
$whereClause = true;
}
}

$return = $this->get($method);
Expand All @@ -195,7 +209,7 @@ protected function callResultMethodsTalkingQuery($method, $split, $parameters)
}

# Return ->row(0) || result('object')
return $return->$result($parameters[0] ?? ($result === 'row' ? 0 : 'object'));
return $return->$result($whereClause);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion zeroneed.php
Expand Up @@ -30,4 +30,4 @@
|
*/

ZN\ZN::run('FE', '5.7.0', 'Vecihi Hürkuş');
ZN\ZN::run('FE', '5.7.0.1', 'Vecihi Hürkuş');

0 comments on commit a41ae69

Please sign in to comment.