[TASK] Streamline phpdoc annotations in EXT:extbase
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / Qom / LogicalOr.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 /**
18 * Performs a logical disjunction of two other constraints.
19 *
20 * To satisfy the Or constraint, the node-tuple must either:
21 * satisfy constraint1 but not constraint2, or
22 * satisfy constraint2 but not constraint1, or
23 * satisfy both constraint1 and constraint2.
24 * @internal only to be used within Extbase, not part of TYPO3 Core API.
25 */
26 class LogicalOr implements OrInterface
27 {
28 /**
29 * @var ConstraintInterface
30 */
31 protected $constraint1;
32
33 /**
34 * @var ConstraintInterface
35 */
36 protected $constraint2;
37
38 /**
39 * @param ConstraintInterface $constraint1
40 * @param ConstraintInterface $constraint2
41 */
42 public function __construct(ConstraintInterface $constraint1, ConstraintInterface $constraint2)
43 {
44 $this->constraint1 = $constraint1;
45 $this->constraint2 = $constraint2;
46 }
47
48 /**
49 * Fills an array with the names of all bound variables in the constraints
50 *
51 * @param array &$boundVariables
52 */
53 public function collectBoundVariableNames(&$boundVariables)
54 {
55 $this->constraint1->collectBoundVariableNames($boundVariables);
56 $this->constraint2->collectBoundVariableNames($boundVariables);
57 }
58
59 /**
60 * Gets the first constraint.
61 *
62 * @return ConstraintInterface the constraint; non-null
63 */
64 public function getConstraint1()
65 {
66 return $this->constraint1;
67 }
68
69 /**
70 * Gets the second constraint.
71 *
72 * @return ConstraintInterface the constraint; non-null
73 */
74 public function getConstraint2()
75 {
76 return $this->constraint2;
77 }
78 }