Skip to content

Commit

Permalink
Revert "Sortable: Allow to check for a particular sort rule"
Browse files Browse the repository at this point in the history
This reverts commit ae21baa.
  • Loading branch information
Johannes Meyer committed Jun 26, 2015
1 parent 0fc8e60 commit cfd43f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
18 changes: 2 additions & 16 deletions library/Icinga/Data/SimpleQuery.php
Expand Up @@ -341,25 +341,11 @@ public function compare($a, $b, $orderIndex = 0)
/**
* Whether an order is set
*
* @param string $column
*
* @return bool
*/
public function hasOrder($column = null)
public function hasOrder()
{
if (empty($this->order)) {
return false;
} elseif ($column === null) {
return true;
}

foreach ($this->order as $rule) {
if ($rule[0] === $column) {
return true;
}
}

return false;
return !empty($this->order);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions library/Icinga/Data/Sortable.php
Expand Up @@ -36,11 +36,9 @@ public function order($field, $direction = null);
/**
* Whether an order is set
*
* @param string $column
*
* @return bool
*/
public function hasOrder($column = null);
public function hasOrder();

/**
* Get the order if any
Expand Down
6 changes: 2 additions & 4 deletions library/Icinga/Repository/RepositoryQuery.php
Expand Up @@ -315,13 +315,11 @@ protected function splitOrder($field)
/**
* Return whether any sort rules were applied to this query
*
* @param string $column
*
* @return bool
*/
public function hasOrder($column = null)
public function hasOrder()
{
return $this->query->hasOrder($column);
return $this->query->hasOrder();
}

/**
Expand Down
6 changes: 2 additions & 4 deletions modules/monitoring/library/Monitoring/DataView/DataView.php
Expand Up @@ -294,13 +294,11 @@ public function order($column = null, $direction = null)
/**
* Whether an order is set
*
* @param string $column
*
* @return bool
*/
public function hasOrder($column = null)
public function hasOrder()
{
return $this->query->hasOrder($column);
return $this->query->hasOrder();
}

/**
Expand Down

0 comments on commit cfd43f2

Please sign in to comment.