Skip to content

Commit

Permalink
Merge pull request #35 from mvorisek/improve_var_names
Browse files Browse the repository at this point in the history
Refactor query variable names
  • Loading branch information
AllanJard authored Jun 17, 2024
2 parents fddfa2f + 49fa119 commit e3f951d
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1596,25 +1596,25 @@ private function _ssp_query($query, $http)
$this->_ssp_filter($query, $http);

// Get the number of rows in the result set
$ssp_set_count = $this->_db
$ssp_set_count_query = $this->_db
->query('count')
->table($this->_read_table())
->get($this->_pkey[0]);
$this->_get_where($ssp_set_count);
$this->_ssp_filter($ssp_set_count, $http);
$ssp_set_count->left_join($this->_leftJoin);
$ssp_set_count = $ssp_set_count->exec()->fetch();
$this->_get_where($ssp_set_count_query);
$this->_ssp_filter($ssp_set_count_query, $http);
$ssp_set_count_query->left_join($this->_leftJoin);
$ssp_set_count = $ssp_set_count_query->exec()->fetch();

// Get the number of rows in the full set
$ssp_full_count = $this->_db
$ssp_full_count_query = $this->_db
->query('count')
->table($this->_read_table())
->get($this->_pkey[0]);
$this->_get_where($ssp_full_count);
$this->_get_where($ssp_full_count_query);
if (count($this->_where)) { // only needed if there is a where condition
$ssp_full_count->left_join($this->_leftJoin);
$ssp_full_count_query->left_join($this->_leftJoin);
}
$ssp_full_count = $ssp_full_count->exec()->fetch();
$ssp_full_count = $ssp_full_count_query->exec()->fetch();

return [
'draw' => (int) $http['draw'],
Expand All @@ -1631,10 +1631,8 @@ private function _ssp_query($query, $http)
* @param int $index Index in the DataTables' submitted data
*
* @return string DB field name
*
* @private Note that it is actually public for PHP 5.3 - thread 39810
*/
public function _ssp_field($http, $index)
private function _ssp_field($http, $index)
{
$name = $http['columns'][$index]['data'];
$field = $this->_find_field($name, 'name');
Expand Down

0 comments on commit e3f951d

Please sign in to comment.