141 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception(
'Tried to get the query settings without seting them before.', 1248689115);
173 if (
$source instanceof \
TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
174 return $source->getSelectorName();
186 if ($this->source === NULL) {
187 $this->source = $this->qomFactory->selector($this->
getType(), $this->dataMapper->convertClassNameToTableName($this->getType()));
199 public function execute($returnRawQueryResult = FALSE) {
200 if ($returnRawQueryResult === TRUE || $this->
getQuerySettings()->getReturnRawQueryResult() === TRUE) {
201 return $this->persistenceManager->getObjectDataByQuery($this);
203 return $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Persistence\\QueryResultInterface', $this);
249 throw new \InvalidArgumentException(
'The limit must be an integer >= 1', 1245071870);
288 throw new \InvalidArgumentException(
'The offset must be a positive integer', 1245071872);
359 if (is_array($constraint1)) {
360 $resultingConstraint = array_shift($constraint1);
361 $constraints = $constraint1;
363 $constraints = func_get_args();
364 $resultingConstraint = array_shift($constraints);
366 if ($resultingConstraint === NULL) {
367 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);
370 $resultingConstraint = $this->qomFactory->_and($resultingConstraint, $constraint);
372 return $resultingConstraint;
384 if (is_array($constraint1)) {
385 $resultingConstraint = array_shift($constraint1);
386 $constraints = $constraint1;
388 $constraints = func_get_args();
389 $resultingConstraint = array_shift($constraints);
391 if ($resultingConstraint === NULL) {
392 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);
395 $resultingConstraint = $this->qomFactory->_or($resultingConstraint, $constraint);
397 return $resultingConstraint;
409 return $this->qomFactory->not($constraint);
421 public function equals($propertyName, $operand, $caseSensitive = TRUE) {
422 if (is_object($operand) || $caseSensitive) {
423 $comparison = $this->qomFactory->comparison(
424 $this->qomFactory->propertyValue($propertyName, $this->getSelectorName()),
429 $comparison = $this->qomFactory->comparison(
430 $this->qomFactory->lowerCase($this->qomFactory->propertyValue($propertyName, $this->getSelectorName())),
447 public function like($propertyName, $operand, $caseSensitive = TRUE) {
448 return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()),
QueryInterface::OPERATOR_LIKE, $operand);
460 public function contains($propertyName, $operand) {
474 public function in($propertyName, $operand) {
475 if (!is_array($operand) && !$operand instanceof \ArrayAccess && !$operand instanceof \Traversable) {
476 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnexpectedTypeException(
'The "in" operator must be given a multivalued operand (array, ArrayAccess, Traversable).', 1264678095);
478 return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()),
QueryInterface::OPERATOR_IN, $operand);
489 public function lessThan($propertyName, $operand) {
534 $this->persistenceManager = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
535 $this->dataMapper = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper');
536 $this->qomFactory = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\QueryObjectModelFactory');
543 return array(
'type',
'source',
'constraint',
'statement',
'orderings',
'limit',
'offset',
'querySettings');
553 return $this->
execute()->count();
567 throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\NotImplementedException(__METHOD__);
const OPERATOR_GREATER_THAN
setSource(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source)
setOrderings(array $orderings)
equals($propertyName, $operand, $caseSensitive=TRUE)
const JCR_JOIN_TYPE_LEFT_OUTER
greaterThan($propertyName, $operand)
const JCR_JOIN_TYPE_INNER
logicalNot(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint)
static makeInstance($className)
execute($returnRawQueryResult=FALSE)
lessThan($propertyName, $operand)
greaterThanOrEqual($propertyName, $operand)
contains($propertyName, $operand)
const OPERATOR_LESS_THAN_OR_EQUAL_TO
like($propertyName, $operand, $caseSensitive=TRUE)
statement($statement, array $parameters=array())
setQuerySettings(QuerySettingsInterface $querySettings)
const JCR_JOIN_TYPE_RIGHT_OUTER
in($propertyName, $operand)
const OPERATOR_GREATER_THAN_OR_EQUAL_TO
lessThanOrEqual($propertyName, $operand)