/** * Performs a logical disjunction of the two given constraints * * @param mixed $constraint1 The first of multiple constraints or an array of constraints. * @throws InvalidNumberOfConstraintsException * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface * @api */ public function logicalOr($constraint1) { if (is_array($constraint1)) { $resultingConstraint = array_shift($constraint1); $constraints = $constraint1; } else { $constraints = func_get_args(); $resultingConstraint = array_shift($constraints); } if ($resultingConstraint === NULL) { throw new InvalidNumberOfConstraintsException('There must be at least one constraint or a non-empty array of constraints given.', 1401289501); } foreach ($constraints as $constraint) { $resultingConstraint = $this->qomFactory->_or($resultingConstraint, $constraint); } return $resultingConstraint; }
/** * Performs a logical disjunction of the two given constraints * * @param mixed $constraint1 The first of multiple constraints or an array of constraints. * @throws Exception\InvalidNumberOfConstraintsException * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface * @api */ public function logicalOr($constraint1) { if (is_array($constraint1)) { $resultingConstraint = array_shift($constraint1); $constraints = $constraint1; } else { $constraints = func_get_args(); $resultingConstraint = array_shift($constraints); } if ($resultingConstraint === NULL) { 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); } foreach ($constraints as $constraint) { $resultingConstraint = $this->qomFactory->_or($resultingConstraint, $constraint); } return $resultingConstraint; }