[TASK] Streamline phpdoc annotations in EXT:extbase
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / Qom / LogicalAnd.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 conjunction of two other constraints.
19 *
20 * To satisfy the And constraint, a node-tuple must satisfy both constraint1 and
21 * constraint2.
22 * @internal only to be used within Extbase, not part of TYPO3 Core API.
23 */
24 class LogicalAnd implements AndInterface
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 {
42 $this->constraint1 = $constraint1;
43 $this->constraint2 = $constraint2;
44 }
45
46 /**
47 * Fills an array with the names of all bound variables in the constraints
48 *
49 * @param array &$boundVariables
50 */
51 public function collectBoundVariableNames(&$boundVariables)
52 {
53 $this->constraint1->collectBoundVariableNames($boundVariables);
54 $this->constraint2->collectBoundVariableNames($boundVariables);
55 }
56
57 /**
58 * Gets the first constraint.
59 *
60 * @return ConstraintInterface the constraint; non-null
61 */
62 public function getConstraint1()
63 {
64 return $this->constraint1;
65 }
66
67 /**
68 * Gets the second constraint.
69 *
70 * @return ConstraintInterface the constraint; non-null
71 */
72 public function getConstraint2()
73 {
74 return $this->constraint2;
75 }
76 }