2 namespace TYPO3\CMS\Extbase\Persistence\Generic;
174 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception(
'Tried to get the query settings without seting them before.', 1248689115);
195 public function setSource(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface
$source)
209 if (
$source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
210 return $source->getSelectorName();
223 if ($this->source === null) {
224 $this->source = $this->qomFactory->selector($this->
getType(), $this->dataMapper->convertClassNameToTableName($this->getType()));
236 public function execute($returnRawQueryResult =
false)
238 if ($returnRawQueryResult) {
239 return $this->persistenceManager->getObjectDataByQuery($this);
241 return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\QueryResultInterface::class, $this);
290 throw new \InvalidArgumentException(
'The limit must be an integer >= 1', 1245071870);
332 throw new \InvalidArgumentException(
'The offset must be a positive integer', 1245071872);
409 if (is_array($constraint1)) {
410 $resultingConstraint = array_shift($constraint1);
411 $constraints = $constraint1;
413 $constraints = func_get_args();
414 $resultingConstraint = array_shift($constraints);
416 if ($resultingConstraint === null) {
417 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\InvalidNumberOfConstraintsException(
'There must be at least one constraint or a non-empty array of constraints given.', 1268056288);
420 $resultingConstraint = $this->qomFactory->_and($resultingConstraint, $constraint);
422 return $resultingConstraint;
435 if (is_array($constraint1)) {
436 $resultingConstraint = array_shift($constraint1);
437 $constraints = $constraint1;
439 $constraints = func_get_args();
440 $resultingConstraint = array_shift($constraints);
442 if ($resultingConstraint === null) {
443 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\InvalidNumberOfConstraintsException(
'There must be at least one constraint or a non-empty array of constraints given.', 1268056289);
446 $resultingConstraint = $this->qomFactory->_or($resultingConstraint, $constraint);
448 return $resultingConstraint;
461 return $this->qomFactory->not($constraint);
473 public function equals($propertyName, $operand, $caseSensitive =
true)
475 if (is_object($operand) || $caseSensitive) {
476 $comparison = $this->qomFactory->comparison(
477 $this->qomFactory->propertyValue($propertyName, $this->getSelectorName()),
482 $comparison = $this->qomFactory->comparison(
483 $this->qomFactory->lowerCase($this->qomFactory->propertyValue($propertyName, $this->getSelectorName())),
485 \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Charset\CharsetConverter::class)->conv_case(\TYPO3\CMS\Extbase\Persistence\Generic\
Query::CHARSET, $operand,
'toLower')
500 public function like($propertyName, $operand, $caseSensitive =
true)
502 return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()),
QueryInterface::OPERATOR_LIKE, $operand);
529 public function in($propertyName, $operand)
531 if (!\TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::isValidTypeForMultiValueComparison($operand)) {
532 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnexpectedTypeException(
'The "in" operator must be given a multivalued operand (array, ArrayAccess, Traversable).', 1264678095);
534 return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()),
QueryInterface::OPERATOR_IN, $operand);
599 public function between($propertyName, $operandLower, $operandUpper)
612 $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
613 $this->persistenceManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
614 $this->dataMapper = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::class);
615 $this->qomFactory = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory::class);
623 return array(
'type',
'source',
'constraint',
'statement',
'orderings',
'limit',
'offset',
'querySettings');
634 return $this->
execute()->count();
649 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\NotImplementedException(__METHOD__);