[TASK] Re-work/simplify copyright header in PHP files - Part 8
[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 * Performs a logical disjunction of two other constraints.
18 *
19 * To satisfy the Or constraint, the node-tuple must either:
20 * satisfy constraint1 but not constraint2, or
21 * satisfy constraint2 but not constraint1, or
22 * satisfy both constraint1 and constraint2.
23 */
24 class LogicalOr implements OrInterface {
25
26 /**
27 * @var ConstraintInterface
28 */
29 protected $constraint1;
30
31 /**
32 * @var ConstraintInterface
33 */
34 protected $constraint2;
35
36 /**
37 * @param ConstraintInterface $constraint1
38 * @param ConstraintInterface $constraint2
39 */
40 public function __construct(ConstraintInterface $constraint1, ConstraintInterface $constraint2) {
41 $this->constraint1 = $constraint1;
42 $this->constraint2 = $constraint2;
43 }
44
45 /**
46 * Fills an array with the names of all bound variables in the constraints
47 *
48 * @param array &$boundVariables
49 * @return void
50 */
51 public function collectBoundVariableNames(&$boundVariables) {
52 $this->constraint1->collectBoundVariablenames($boundVariables);
53 $this->constraint2->collectBoundVariablenames($boundVariables);
54 }
55
56 /**
57 * Gets the first constraint.
58 *
59 * @return ConstraintInterface the constraint; non-null
60 */
61 public function getConstraint1() {
62 return $this->constraint1;
63 }
64
65 /**
66 * Gets the second constraint.
67 *
68 * @return ConstraintInterface the constraint; non-null
69 */
70 public function getConstraint2() {
71 return $this->constraint2;
72 }
73 }