-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Table: performance, prevents multiple parse of query parts by regexp (#…
…131)
- Loading branch information
Showing
3 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,39 @@ public function buildDeleteQuery() | |
} | ||
|
||
|
||
/** | ||
* Returns select query hash for caching. | ||
* @return string | ||
*/ | ||
public function getSelectQueryHash($columns = NULL) | ||
{ | ||
$parts = [ | ||
'delimitedTable' => $this->delimitedTable, | ||
'queryCondition' => $this->buildConditions(), | ||
'queryEnd' => $this->buildQueryEnd(), | ||
$this->aliases, | ||
$this->limit, $this->offset, | ||
]; | ||
if ($this->select) { | ||
$parts[] = $this->select; | ||
} elseif ($columns) { | ||
$parts[] = [$this->delimitedTable, $columns]; | ||
} elseif ($this->group && !$this->driver->isSupported(ISupplementalDriver::SUPPORT_SELECT_UNGROUPED_COLUMNS)) { | ||
$parts[] = [$this->group]; | ||
} else { | ||
$parts[] = "{$this->delimitedTable}.*"; | ||
} | ||
return $this->getConditionHash(json_encode($parts), array_merge( | ||
$this->parameters['select'], | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
norbe
Author
Contributor
|
||
$this->parameters['joinCondition'] ? call_user_func_array('array_merge', $this->parameters['joinCondition']) : [], | ||
$this->parameters['where'], | ||
$this->parameters['group'], | ||
$this->parameters['having'], | ||
$this->parameters['order'] | ||
)); | ||
} | ||
|
||
|
||
/** | ||
* Returns SQL query. | ||
* @param string list of columns | ||
|
Why not variadic unpacking?