Skip to content

Commit 82d4657

Browse files
committed
Add getOrderBy method
1 parent 6abb498 commit 82d4657

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Repositories/AbstractRepository.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function newQuery($skipOrdering = false)
169169

170170
// Apply order by
171171
if ($skipOrdering === false && $this->skipOrderingOnce === false) {
172-
foreach ($this->orderBy as $column => $dir) {
172+
foreach ($this->getOrderBy() as $column => $dir) {
173173
$this->query->orderBy($column, $dir);
174174
}
175175
}
@@ -312,6 +312,16 @@ public function orderBy($column, $direction)
312312
});
313313
}
314314

315+
/**
316+
* Return the order by array.
317+
*
318+
* @return array
319+
*/
320+
public function getOrderBy()
321+
{
322+
return $this->orderBy;
323+
}
324+
315325
/**
316326
* Return searchable keys.
317327
*

0 commit comments

Comments
 (0)