Skip to content

Commit 4c221d2

Browse files
committed
Fix doc blocks and CS.
1 parent 86a3a3f commit 4c221d2

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

src/Engines/BaseEngine.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -597,14 +597,7 @@ public function make($mDataSupport = false, $orderFirst = false)
597597
}
598598

599599
/**
600-
* Count results.
601-
*
602-
* @return integer
603-
*/
604-
abstract public function count();
605-
606-
/**
607-
* Count total items
600+
* Count total items.
608601
*
609602
* @return integer
610603
*/
@@ -663,6 +656,13 @@ abstract public function filtering();
663656
*/
664657
abstract public function columnSearch();
665658

659+
/**
660+
* Count results.
661+
*
662+
* @return integer
663+
*/
664+
abstract public function count();
665+
666666
/**
667667
* Apply pagination.
668668
*

src/Engines/CollectionEngine.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Illuminate\Support\Str;
1818
use Yajra\Datatables\Contracts\DataTableEngineContract;
1919
use Yajra\Datatables\Request;
20-
use Yajra\Datatables\Helper;
2120

2221
class CollectionEngine extends BaseEngine implements DataTableEngineContract
2322
{
@@ -78,21 +77,20 @@ public function showDebugger(array $output)
7877
return $output;
7978
}
8079

81-
8280
/**
8381
* @inheritdoc
8482
*/
85-
public function count()
83+
public function totalCount()
8684
{
87-
return $this->collection->count();
85+
return $this->count();
8886
}
89-
87+
9088
/**
9189
* @inheritdoc
9290
*/
93-
public function totalCount()
91+
public function count()
9492
{
95-
return $this->count();
93+
return $this->collection->count();
9694
}
9795

9896
/**
@@ -124,9 +122,9 @@ public function filtering()
124122
$columns = $this->request['columns'];
125123
$this->collection = $this->collection->filter(
126124
function ($row) use ($columns) {
127-
$data = $this->serialize($row);
125+
$data = $this->serialize($row);
128126
$this->isFilterApplied = true;
129-
$found = [];
127+
$found = [];
130128

131129
$keyword = $this->request->keyword();
132130
foreach ($this->request->searchableColumnIndex() as $index) {

src/Engines/QueryBuilderEngine.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ public function make($mDataSupport = false, $orderFirst = false)
6767
return parent::make($mDataSupport, $orderFirst);
6868
}
6969

70+
/**
71+
* @inheritdoc
72+
*/
73+
public function totalCount()
74+
{
75+
return $this->count();
76+
}
77+
7078
/**
7179
* Counts current query.
7280
*
@@ -85,14 +93,6 @@ public function count()
8593
return $this->connection->table($this->connection->raw('(' . $myQuery->toSql() . ') count_row_table'))
8694
->setBindings($myQuery->getBindings())->count();
8795
}
88-
89-
/**
90-
* @inheritdoc
91-
*/
92-
public function totalCount()
93-
{
94-
return $this->count();
95-
}
9696

9797
/**
9898
* @inheritdoc

0 commit comments

Comments
 (0)