91451ee16d1f694f99eda2d0fd713c981e2ee8b3
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / Qom / EquiJoinCondition.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * Tests whether the value of a property in a first selector is equal to the value of a
18 * property in a second selector.
19 * A node-tuple satisfies the constraint only if: the selector1Name node has a property named property1Name, and
20 * the selector2Name node has a property named property2Name, and
21 * the value of property property1Name is equal to the value of property property2Name.
22 */
23 class EquiJoinCondition implements EquiJoinConditionInterface {
24
25 /**
26 * @var string
27 */
28 protected $selector1Name;
29
30 /**
31 * @var string
32 */
33 protected $property1Name;
34
35 /**
36 * @var string
37 */
38 protected $selector2Name;
39
40 /**
41 * @var string
42 */
43 protected $property2Name;
44
45 /**
46 * Constructs this EquiJoinCondition instance
47 *
48 * @param string $selector1Name the name of the first selector; non-null
49 * @param string $property1Name the property name in the first selector; non-null
50 * @param string $selector2Name the name of the second selector; non-null
51 * @param string $property2Name the property name in the second selector; non-null
52 */
53 public function __construct($selector1Name, $property1Name, $selector2Name, $property2Name) {
54 // TODO Test for selector1Name = selector2Name -> exception
55 $this->selector1Name = $selector1Name;
56 $this->property1Name = $property1Name;
57 $this->selector2Name = $selector2Name;
58 $this->property2Name = $property2Name;
59 }
60
61 /**
62 * Gets the name of the first selector.
63 *
64 * @return string the selector name; non-null
65 */
66 public function getSelector1Name() {
67 return $this->selector1Name;
68 }
69
70 /**
71 * Gets the name of the first property.
72 *
73 * @return string the property name; non-null
74 */
75 public function getProperty1Name() {
76 return $this->property1Name;
77 }
78
79 /**
80 * Gets the name of the second selector.
81 *
82 * @return string the selector name; non-null
83 */
84 public function getSelector2Name() {
85 return $this->selector2Name;
86 }
87
88 /**
89 * Gets the name of the second property.
90 *
91 * @return string the property name; non-null
92 */
93 public function getProperty2Name() {
94 return $this->property2Name;
95 }
96
97 /**
98 * Gets the name of the child selector.
99 *
100 * @return string the selector name; non-null
101 */
102 public function getChildSelectorName() {
103 return '';
104 }
105
106 /**
107 * Gets the name of the parent selector.
108 *
109 * @return string the selector name; non-null
110 */
111 public function getParentSelectorName() {
112 return '';
113 }
114 }