Skip to content

Commit

Permalink
Merge pull request netgen#80 from mivancic/fix-Pagerfanta-use-new-ada…
Browse files Browse the repository at this point in the history
…pter

Use new FilterAdapter instead of deprecated LocationSearchFilterAdapter
  • Loading branch information
pspanja committed Jul 26, 2018
2 parents 71cd513 + f9fc508 commit cf40780
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/Core/Site/Values/Content.php
Expand Up @@ -10,7 +10,7 @@
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause\Location\Path;
use Netgen\EzPlatformSiteApi\API\Values\Content as APIContent;
use Netgen\EzPlatformSiteApi\Core\Site\Pagination\Pagerfanta\LocationSearchFilterAdapter;
use Netgen\EzPlatformSiteApi\Core\Site\Pagination\Pagerfanta\FilterAdapter;
use Pagerfanta\Adapter\ArrayAdapter;
use Pagerfanta\Pagerfanta;

Expand Down Expand Up @@ -275,7 +275,7 @@ public function getLocations($limit = 25)
public function filterLocations($maxPerPage = 25, $currentPage = 1)
{
$pager = new Pagerfanta(
new LocationSearchFilterAdapter(
new FilterAdapter(
new LocationQuery([
'filter' => new LogicalAnd(
[
Expand Down
4 changes: 2 additions & 2 deletions lib/Core/Site/Values/ContentInfo.php
Expand Up @@ -8,7 +8,7 @@
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause\Location\Path;
use Netgen\EzPlatformSiteApi\API\Values\ContentInfo as APIContentInfo;
use Netgen\EzPlatformSiteApi\Core\Site\Pagination\Pagerfanta\LocationSearchFilterAdapter;
use Netgen\EzPlatformSiteApi\Core\Site\Pagination\Pagerfanta\FilterAdapter;
use Pagerfanta\Pagerfanta;

final class ContentInfo extends APIContentInfo
Expand Down Expand Up @@ -159,7 +159,7 @@ public function getLocations($limit = 25)
public function filterLocations($maxPerPage = 25, $currentPage = 1)
{
$pager = new Pagerfanta(
new LocationSearchFilterAdapter(
new FilterAdapter(
new LocationQuery([
'filter' => new LogicalAnd(
[
Expand Down
6 changes: 3 additions & 3 deletions lib/Core/Site/Values/Location.php
Expand Up @@ -14,7 +14,7 @@
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
use Netgen\EzPlatformSiteApi\API\Values\Location as APILocation;
use Netgen\EzPlatformSiteApi\Core\Site\Pagination\Pagerfanta\LocationSearchFilterAdapter;
use Netgen\EzPlatformSiteApi\Core\Site\Pagination\Pagerfanta\FilterAdapter;
use Pagerfanta\Pagerfanta;

final class Location extends APILocation
Expand Down Expand Up @@ -202,7 +202,7 @@ public function filterChildren(array $contentTypeIdentifiers = [], $maxPerPage =
}

$pager = new Pagerfanta(
new LocationSearchFilterAdapter(
new FilterAdapter(
new LocationQuery([
'filter' => new LogicalAnd($criteria),
'sortClauses' => $this->getSortClauses(),
Expand Down Expand Up @@ -238,7 +238,7 @@ public function filterSiblings(array $contentTypeIdentifiers = [], $maxPerPage =
}

$pager = new Pagerfanta(
new LocationSearchFilterAdapter(
new FilterAdapter(
new LocationQuery([
'filter' => new LogicalAnd($criteria),
'sortClauses' => $this->getSortClauses(),
Expand Down
6 changes: 3 additions & 3 deletions lib/Core/Site/Values/Node.php
Expand Up @@ -14,7 +14,7 @@
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
use Netgen\EzPlatformSiteApi\API\Values\Node as APINode;
use Netgen\EzPlatformSiteApi\Core\Site\Pagination\Pagerfanta\LocationSearchFilterAdapter;
use Netgen\EzPlatformSiteApi\Core\Site\Pagination\Pagerfanta\FilterAdapter;
use Pagerfanta\Pagerfanta;

final class Node extends APINode
Expand Down Expand Up @@ -149,7 +149,7 @@ public function filterChildren(array $contentTypeIdentifiers = [], $maxPerPage =
}

$pager = new Pagerfanta(
new LocationSearchFilterAdapter(
new FilterAdapter(
new LocationQuery([
'filter' => new LogicalAnd($criteria),
'sortClauses' => $this->getSortClauses(),
Expand Down Expand Up @@ -185,7 +185,7 @@ public function filterSiblings(array $contentTypeIdentifiers = [], $maxPerPage =
}

$pager = new Pagerfanta(
new LocationSearchFilterAdapter(
new FilterAdapter(
new LocationQuery([
'filter' => new LogicalAnd($criteria),
'sortClauses' => $this->getSortClauses(),
Expand Down

0 comments on commit cf40780

Please sign in to comment.