Skip to content

Commit

Permalink
Fixed #2 bug;
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ome committed Feb 24, 2015
2 parents d7f2ccc + 2b6a528 commit 9200970
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions spec/suite/Adapters/ArraySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
],
'order' => [
[
'column' => 'name',
'column' => 0,
'dir' => 'desc'
]
]
Expand Down Expand Up @@ -224,7 +224,7 @@
],
'order' => [
[
'column' => 'name',
'column' => 0,
'dir' => 'asc'
]
]
Expand Down
4 changes: 2 additions & 2 deletions spec/suite/Adapters/QueryBuilderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
],
'order' => [
[
'column' => 'name',
'column' => 0,
'dir' => 'desc'
]
]
Expand Down Expand Up @@ -224,7 +224,7 @@
],
'order' => [
[
'column' => 'name',
'column' => 0,
'dir' => 'asc'
]
]
Expand Down
4 changes: 2 additions & 2 deletions spec/suite/Adapters/ResultSetSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
],
'order' => [
[
'column' => 'name',
'column' => 0,
'dir' => 'desc'
]
]
Expand Down Expand Up @@ -227,7 +227,7 @@
],
'order' => [
[
'column' => 'name',
'column' => 0,
'dir' => 'asc'
]
]
Expand Down
4 changes: 2 additions & 2 deletions src/Adapters/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ public function bind($case, $closure) {

$orderArray = [];

foreach($order as $columnId=>$orderBy) {
foreach($order as $orderBy) {
if (!isset($orderBy['dir']) || !isset($orderBy['column'])) continue;
$orderDir = $orderBy['dir'];

$column = $this->parser->getColumnById($columnId);
$column = $this->parser->getColumnById($orderBy['column']);
if (is_null($column) || !$this->columnExists($column)) continue;

$orderArray[] = "{$column} {$orderDir}";
Expand Down

0 comments on commit 9200970

Please sign in to comment.