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

API/Repository/Values/Content/Query/Criterion/Visibility.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\API\Repository\Values\Content\Query\Criterion;
8
9 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
10 use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications;
11 use InvalidArgumentException;
12
20 class Visibility extends Criterion
21 {
25 const VISIBLE = 0;
26
30 const HIDDEN = 1;
31
39 public function __construct($value)
40 {
41 if ($value !== self::VISIBLE && $value !== self::HIDDEN) {
42 throw new InvalidArgumentException("Invalid visibility value $value");
43 }
44
45 parent::__construct(null, null, $value);
46 }
47
48 public function getSpecifications()
49 {
50 return [
51 new Specifications(
52 Operator::EQ,
53 Specifications::FORMAT_SINGLE,
54 Specifications::TYPE_INTEGER
55 ),
56 ];
57 }
58
62 public static function createFromQueryBuilder($target, $operator, $value)
63 {
64 @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 7.2 and will be removed in 8.0.', E_USER_DEPRECATED);
65
66 return new self($value);
67 }
68 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications
This class is used by Criteria to describe which operators they support.
Definition: Specifications.php:15
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications\TYPE_INTEGER
const TYPE_INTEGER
Criterion input value type description constants.
Definition: Specifications.php:26
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\Specifications\FORMAT_SINGLE
const FORMAT_SINGLE
Criterion input type description constants.
Definition: Specifications.php:19
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator\EQ
const EQ
Definition: API/Repository/Values/Content/Query/Criterion/Operator.php:16
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\Visibility\VISIBLE
const VISIBLE
Visibility constant: visible.
Definition: API/Repository/Values/Content/Query/Criterion/Visibility.php:25
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility\createFromQueryBuilder
static createFromQueryBuilder($target, $operator, $value)
Definition: API/Repository/Values/Content/Query/Criterion/Visibility.php:62
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility\__construct
__construct($value)
Creates a new Visibility criterion.
Definition: API/Repository/Values/Content/Query/Criterion/Visibility.php:39
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility\HIDDEN
const HIDDEN
Visibility constant: hidden.
Definition: API/Repository/Values/Content/Query/Criterion/Visibility.php:30
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Visibility\getSpecifications
getSpecifications()
Criterion description function.
Definition: API/Repository/Values/Content/Query/Criterion/Visibility.php:48
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
eZ\Publish\API\Repository\Values\Content\Query\Criterion\$target
$target
Definition: API/Repository/Values/Content/Query/Criterion.php:35
eZ\Publish\API\Repository\Values\Content\Query\Criterion\$operator
$operator
Definition: API/Repository/Values/Content/Query/Criterion.php:21
eZ\Publish\API\Repository\Values\Content\Query\Criterion\$value
$value
Definition: API/Repository/Values/Content/Query/Criterion.php:28
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion/Ancestor.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.