File tree Expand file tree Collapse file tree 2 files changed +102
-0
lines changed Expand file tree Collapse file tree 2 files changed +102
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace WikibaseSolutions \CypherDSL ;
4
+
5
+ use WikibaseSolutions \CypherDSL \Traits \BooleanTypeTrait ;
6
+ use WikibaseSolutions \CypherDSL \Types \AnyType ;
7
+ use WikibaseSolutions \CypherDSL \Types \PropertyTypes \BooleanType ;
8
+ use function sprintf ;
9
+
10
+ /**
11
+ * Represents the IS NOT NULL comparison operator.
12
+ *
13
+ * @see https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-comparison
14
+ */
15
+ class IsNotNull implements BooleanType
16
+ {
17
+ use BooleanTypeTrait;
18
+
19
+ /**
20
+ * @var AnyType The type to test against null
21
+ */
22
+ private AnyType $ expression ;
23
+
24
+ /**
25
+ * IS NOT NULL constructor.
26
+ *
27
+ * @param AnyType $expression The type to test against null.
28
+ */
29
+ public function __construct (AnyType $ expression )
30
+ {
31
+ $ this ->expression = $ expression ;
32
+ }
33
+
34
+ /**
35
+ * Returns the expression to test against null.
36
+ *
37
+ * @return AnyType
38
+ */
39
+ public function getExpression (): AnyType
40
+ {
41
+ return $ this ->expression ;
42
+ }
43
+
44
+ /**
45
+ * @inheritDoc
46
+ */
47
+ public function toQuery (): string
48
+ {
49
+ return sprintf ("(%s IS NOT NULL) " , $ this ->expression ->toQuery ());
50
+ }
51
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace WikibaseSolutions \CypherDSL ;
4
+
5
+ use WikibaseSolutions \CypherDSL \Traits \BooleanTypeTrait ;
6
+ use WikibaseSolutions \CypherDSL \Types \AnyType ;
7
+ use WikibaseSolutions \CypherDSL \Types \PropertyTypes \BooleanType ;
8
+ use function sprintf ;
9
+
10
+ /**
11
+ * Represents the IS NULL comparison operator.
12
+ *
13
+ * @see https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-comparison
14
+ */
15
+ class IsNull implements BooleanType
16
+ {
17
+ use BooleanTypeTrait;
18
+
19
+ /**
20
+ * @var AnyType The type to test against null
21
+ */
22
+ private AnyType $ expression ;
23
+
24
+ /**
25
+ * IS NULL constructor.
26
+ *
27
+ * @param AnyType $expression The type to test against null.
28
+ */
29
+ public function __construct (AnyType $ expression )
30
+ {
31
+ $ this ->expression = $ expression ;
32
+ }
33
+
34
+ /**
35
+ * Returns the expression to test against null.
36
+ *
37
+ * @return AnyType
38
+ */
39
+ public function getExpression (): AnyType
40
+ {
41
+ return $ this ->expression ;
42
+ }
43
+
44
+ /**
45
+ * @inheritDoc
46
+ */
47
+ public function toQuery (): string
48
+ {
49
+ return sprintf ("(%s IS NULL) " , $ this ->expression ->toQuery ());
50
+ }
51
+ }
You can’t perform that action at this time.
0 commit comments