Skip to content

Commit

Permalink
DEMO-194: Query Type (ezsystems#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciastektk authored and damianz5 committed Sep 14, 2018
1 parent 32fb986 commit 9a0cb2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/config/views.yml
Expand Up @@ -102,6 +102,7 @@ ezpublish:
query_type: "AppBundle:Children"
parameters:
parent_location_id: '@=location.id'
included_content_type_identifier: 'product'
assign_results_to: children
template: "@ezdesign/full/product_list.html.twig"
match:
Expand Down
4 changes: 4 additions & 0 deletions src/AppBundle/QueryType/ChildrenQueryType.php
Expand Up @@ -22,6 +22,10 @@ public function getQuery(array $parameters = [])
$criteria[] = new Query\Criterion\MatchNone();
}

if (!empty($parameters['included_content_type_identifier'])) {
$criteria[] = new Query\Criterion\ContentTypeIdentifier($parameters['included_content_type_identifier']);
}

$options['filter'] = new Query\Criterion\LogicalAnd($criteria);

if (isset($parameters['limit'])) {
Expand Down

0 comments on commit 9a0cb2f

Please sign in to comment.