lib/Core/Pagination/InformationCollectionCollectionListAdapter.php 1 location
|
@@ 7-30 (lines=24) @@
|
4 |
|
|
5 |
|
namespace Netgen\InformationCollection\Core\Pagination; |
6 |
|
|
7 |
|
class InformationCollectionCollectionListAdapter extends BaseAdapter |
8 |
|
{ |
9 |
|
public function getNbResults() |
10 |
|
{ |
11 |
|
if (!isset($this->nbResults)) { |
12 |
|
$this->nbResults = $this->informationCollectionService |
13 |
|
->getCollections($this->getCountQuery()) |
14 |
|
->count; |
15 |
|
} |
16 |
|
|
17 |
|
return $this->nbResults; |
18 |
|
} |
19 |
|
|
20 |
|
public function getSlice($offset, $length) |
21 |
|
{ |
22 |
|
$objects = $this->informationCollectionService |
23 |
|
->getCollections($this->getQuery($offset, $length)) |
24 |
|
->collections; |
25 |
|
|
26 |
|
$this->getNbResults(); |
27 |
|
|
28 |
|
return $objects; |
29 |
|
} |
30 |
|
} |
31 |
|
|
lib/Core/Pagination/InformationCollectionCollectionListSearchAdapter.php 1 location
|
@@ 7-30 (lines=24) @@
|
4 |
|
|
5 |
|
namespace Netgen\InformationCollection\Core\Pagination; |
6 |
|
|
7 |
|
class InformationCollectionCollectionListSearchAdapter extends BaseAdapter |
8 |
|
{ |
9 |
|
public function getNbResults() |
10 |
|
{ |
11 |
|
if (!isset($this->nbResults)) { |
12 |
|
$this->nbResults = $this->informationCollectionService |
13 |
|
->search($this->getCountQuery()) |
14 |
|
->count; |
15 |
|
} |
16 |
|
|
17 |
|
return $this->nbResults; |
18 |
|
} |
19 |
|
|
20 |
|
public function getSlice($offset, $length) |
21 |
|
{ |
22 |
|
$objects = $this->informationCollectionService |
23 |
|
->search($this->getQuery($offset, $length)) |
24 |
|
->collections; |
25 |
|
|
26 |
|
$this->getNbResults(); |
27 |
|
|
28 |
|
return $objects; |
29 |
|
} |
30 |
|
} |
31 |
|
|
lib/Core/Pagination/InformationCollectionContentsAdapter.php 1 location
|
@@ 7-30 (lines=24) @@
|
4 |
|
|
5 |
|
namespace Netgen\InformationCollection\Core\Pagination; |
6 |
|
|
7 |
|
class InformationCollectionContentsAdapter extends BaseAdapter |
8 |
|
{ |
9 |
|
public function getNbResults() |
10 |
|
{ |
11 |
|
if (!isset($this->nbResults)) { |
12 |
|
$this->nbResults = $this->informationCollectionService |
13 |
|
->getObjectsWithCollections($this->getCountQuery()) |
14 |
|
->count; |
15 |
|
} |
16 |
|
|
17 |
|
return $this->nbResults; |
18 |
|
} |
19 |
|
|
20 |
|
public function getSlice($offset, $length) |
21 |
|
{ |
22 |
|
$objects = $this->informationCollectionService |
23 |
|
->getObjectsWithCollections($this->getQuery($offset, $length)) |
24 |
|
->contents; |
25 |
|
|
26 |
|
$this->getNbResults(); |
27 |
|
|
28 |
|
return $objects; |
29 |
|
} |
30 |
|
} |
31 |
|
|