Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Core/Search/Legacy/Content/Location/Gateway/CriterionHandler/Visibility.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler;
8
9 use eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler;
10 use eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriteriaConverter;
11 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
12 use RuntimeException;
13 use eZ\Publish\Core\Persistence\Database\SelectQuery;
14 use PDO;
15
19 class Visibility extends CriterionHandler
20 {
28 public function accept(Criterion $criterion)
29 {
30 return $criterion instanceof Criterion\Visibility;
31 }
32
45 public function handle(
46 CriteriaConverter $converter,
47 SelectQuery $query,
48 Criterion $criterion,
49 array $languageSettings
50 ) {
51 $column = $this->dbHandler->quoteColumn('is_invisible', 'ezcontentobject_tree');
52
53 switch ($criterion->value[0]) {
54 case Criterion\Visibility::VISIBLE:
55 return $query->expr->eq(
56 $column,
57 $query->bindValue(0, null, PDO::PARAM_INT)
58 );
59
60 case Criterion\Visibility::HIDDEN:
61 return $query->expr->eq(
62 $column,
63 $query->bindValue(1, null, PDO::PARAM_INT)
64 );
65
66 default:
67 throw new RuntimeException(
68 "Unknown value '{$criterion->value[0]}' for Visibility criterion handler."
69 );
70 }
71 }
72 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility
A criterion that matches content based on its visibility.
Definition: API/Repository/Values/Content/Query/Criterion/Visibility.php:21
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriteriaConverter
Content locator gateway implementation using the DoctrineDatabase.
Definition: Search/Legacy/Content/Common/Gateway/CriteriaConverter.php:17
eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler
Definition: Search/Legacy/Content/Common/Gateway/CriterionHandler.php:15
eZ\Publish\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler\Visibility\accept
accept(Criterion $criterion)
Check if this criterion handler accepts to handle the given criterion.
Definition: Core/Search/Legacy/Content/Location/Gateway/CriterionHandler/Visibility.php:28
eZ\Publish\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler\Visibility\handle
handle(CriteriaConverter $converter, SelectQuery $query, Criterion $criterion, array $languageSettings)
Generate query expression for a Criterion this handler accepts.
Definition: Core/Search/Legacy/Content/Location/Gateway/CriterionHandler/Visibility.php:45
eZ\Publish\Core\Persistence\Database\Query\bindValue
bindValue($value, $placeHolder=null, $type=PDO::PARAM_STR)
Binds the value $value to the specified variable name $placeHolder.
eZ\Publish\Core\Persistence\Database\SelectQuery
Definition: SelectQuery.php:16
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion/Ancestor.php:7
eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler
Definition: Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/ContentId.php:7
eZ\Publish\Core\Search\Legacy\Content\Location\Gateway\CriterionHandler
Definition: Core/Search/Legacy/Content/Location/Gateway/CriterionHandler/Ancestor.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.