@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -spl_autoload_register(function ($class) { |
|
| 3 | +spl_autoload_register(function($class) { |
|
| 4 | 4 | if (strpos($class, 'SimpleCrud\\') !== 0) { |
| 5 | 5 | return; |
| 6 | 6 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | */ |
| 10 | 10 | class Select extends BaseSelect |
| 11 | 11 | { |
| 12 | - /** |
|
| 12 | + /** |
|
| 13 | 13 | * {@inheritdoc} |
| 14 | 14 | */ |
| 15 | 15 | protected static function buildFoundRows() |
@@ -21,19 +21,19 @@ discard block |
||
| 21 | 21 | * {@inheritdoc} |
| 22 | 22 | */ |
| 23 | 23 | protected function getFoundRows() { |
| 24 | - $query = $this->table->count(); |
|
| 24 | + $query = $this->table->count(); |
|
| 25 | 25 | |
| 26 | - $query->marks($this->marks); |
|
| 26 | + $query->marks($this->marks); |
|
| 27 | 27 | |
| 28 | - foreach ($this->where as $k => $where) { |
|
| 29 | - if ($k === 'or') { |
|
| 30 | - foreach ($where as $condition) { |
|
| 31 | - $query->orWhere($condition); |
|
| 32 | - } |
|
| 33 | - } else { |
|
| 34 | - $query->where($where); |
|
| 35 | - } |
|
| 36 | - } |
|
| 28 | + foreach ($this->where as $k => $where) { |
|
| 29 | + if ($k === 'or') { |
|
| 30 | + foreach ($where as $condition) { |
|
| 31 | + $query->orWhere($condition); |
|
| 32 | + } |
|
| 33 | + } else { |
|
| 34 | + $query->where($where); |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | 38 | return $query->run(); |
| 39 | 39 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if ($this->calcFoundRows) { |
| 109 | 109 | $total = $this->getFoundRows(); |
| 110 | 110 | |
| 111 | - $result->setMethod('getTotal', function () use ($total) { |
|
| 111 | + $result->setMethod('getTotal', function() use ($total) { |
|
| 112 | 112 | return $total; |
| 113 | 113 | }); |
| 114 | 114 | } |
@@ -123,15 +123,15 @@ discard block |
||
| 123 | 123 | // $next = ($current * $this->limit) < $total ? $current + 1 : null; |
| 124 | 124 | $prev = $current > 1 ? $current - 1 : null; |
| 125 | 125 | |
| 126 | - $result->setMethod('getPage', function () use ($current) { |
|
| 126 | + $result->setMethod('getPage', function() use ($current) { |
|
| 127 | 127 | return $current; |
| 128 | 128 | }); |
| 129 | 129 | |
| 130 | - $result->setMethod('getNextPage', function () use ($next) { |
|
| 130 | + $result->setMethod('getNextPage', function() use ($next) { |
|
| 131 | 131 | return $next; |
| 132 | 132 | }); |
| 133 | 133 | |
| 134 | - $result->setMethod('getPrevPage', function () use ($prev) { |
|
| 134 | + $result->setMethod('getPrevPage', function() use ($prev) { |
|
| 135 | 135 | return $prev; |
| 136 | 136 | }); |
| 137 | 137 | } |