Skip to content

Commit

Permalink
Merge pull request #36 from Raistlfiren/hotfix-parser
Browse files Browse the repository at this point in the history
Query parser Fix #34
  • Loading branch information
Raistlfiren authored Dec 6, 2016
2 parents d62f564 + 4173cd4 commit 77bee2f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Provider/APIProvider.php
Original file line number Diff line number Diff line change
@@ -14,6 +14,8 @@
use Bolt\Extension\Bolt\JsonApi\Storage\Query\Handler\PagingHandler;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Bolt\Storage\Query\ContentQueryParser;


/**
* Class APIProvider
@@ -152,9 +154,13 @@ function ($classMetadata) use ($app) {
}
);

$app['query.parser']->addDirectiveHandler('paginate', new PagerHandler());
$app['query.parser']->addHandler('pager', new PagingHandler());
$app['query.parser']->addOperation('pager');
$app->extend('query.parser', function (ContentQueryParser $parser) {
$parser->addDirectiveHandler('paginate', new PagerHandler());
$parser->addHandler('pager', new PagingHandler());
$parser->addOperation('pager');

return $parser;
});
}

/**

0 comments on commit 77bee2f

Please sign in to comment.