TYPO3 CMS  TYPO3_8-7
QueryObjectModelFactory.php
Go to the documentation of this file.
1 <?php
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 
21 {
25  protected $objectManager;
26 
30  public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
31  {
32  $this->objectManager = $objectManager;
33  }
34 
43  public function selector($nodeTypeName, $selectorName = '')
44  {
45  if ($selectorName === '') {
46  $selectorName = $nodeTypeName;
47  }
48  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Selector::class, $selectorName, $nodeTypeName);
49  }
50 
58  public function statement($statement, array $boundVariables = [])
59  {
60  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement::class, $statement, $boundVariables);
61  }
62 
72  public function join(SourceInterface $left, SourceInterface $right, $joinType, JoinConditionInterface $joinCondition)
73  {
74  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Join::class, $left, $right, $joinType, $joinCondition);
75  }
76 
87  public function equiJoinCondition($selector1Name, $property1Name, $selector2Name, $property2Name)
88  {
89  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\EquiJoinCondition::class, $selector1Name, $property1Name, $selector2Name, $property2Name);
90  }
91 
100  public function _and(ConstraintInterface $constraint1, ConstraintInterface $constraint2)
101  {
102  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\LogicalAnd::class, $constraint1, $constraint2);
103  }
104 
113  public function _or(ConstraintInterface $constraint1, ConstraintInterface $constraint2)
114  {
115  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\LogicalOr::class, $constraint1, $constraint2);
116  }
117 
125  public function not(ConstraintInterface $constraint)
126  {
127  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\LogicalNot::class, $constraint);
128  }
129 
139  public function comparison(PropertyValueInterface $operand1, $operator, $operand2)
140  {
141  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Comparison::class, $operand1, $operator, $operand2);
142  }
143 
152  public function propertyValue($propertyName, $selectorName = '')
153  {
154  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\PropertyValue::class, $propertyName, $selectorName);
155  }
156 
164  public function lowerCase(PropertyValueInterface $operand)
165  {
166  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\LowerCase::class, $operand);
167  }
168 
176  public function upperCase(PropertyValueInterface $operand)
177  {
178  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\UpperCase::class, $operand);
179  }
180 
190  public function ascending(DynamicOperandInterface $operand)
191  {
192  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Ordering::class, $operand, \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING);
193  }
194 
204  public function descending(DynamicOperandInterface $operand)
205  {
206  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Ordering::class, $operand, \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING);
207  }
208 
216  public function bindVariable($bindVariableName)
217  {
218  return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\BindVariableValue::class, $bindVariableName);
219  }
220 }
injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
equiJoinCondition($selector1Name, $property1Name, $selector2Name, $property2Name)
comparison(PropertyValueInterface $operand1, $operator, $operand2)
_and(ConstraintInterface $constraint1, ConstraintInterface $constraint2)
_or(ConstraintInterface $constraint1, ConstraintInterface $constraint2)
join(SourceInterface $left, SourceInterface $right, $joinType, JoinConditionInterface $joinCondition)