/**
  * Returns a greater than or equal criterion used for matching objects against a query
  *
  * @param string $propertyName The name of the property to compare against
  * @param mixed $operand The value to compare with
  * @return \TYPO3\Flow\Persistence\Generic\Qom\Comparison
  * @throws \TYPO3\Flow\Persistence\Exception\InvalidQueryException if used on a multi-valued property or with a non-literal/non-DateTime operand
  * @api
  */
 public function greaterThanOrEqual($propertyName, $operand)
 {
     if ($this->classSchema->isMultiValuedProperty($propertyName)) {
         throw new \TYPO3\Flow\Persistence\Exception\InvalidQueryException('Property "' . $propertyName . '" must not be multi-valued', 1276774883);
     }
     if (!$operand instanceof \DateTime && !\TYPO3\Flow\Utility\TypeHandling::isLiteral(gettype($operand))) {
         throw new \TYPO3\Flow\Persistence\Exception\InvalidQueryException('Operand must be a literal or DateTime, was ' . gettype($operand), 1276774884);
     }
     return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, '_entity'), \TYPO3\Flow\Persistence\QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO, $operand);
 }
 /**
  * Assigns the repository of any aggregate root to all it's
  * subclasses, unless they are aggregate root already.
  *
  * @param ClassSchema $classSchema
  * @return void
  */
 protected function makeChildClassesAggregateRoot(ClassSchema $classSchema)
 {
     foreach ($this->getAllSubClassNamesForClass($classSchema->getClassName()) as $childClassName) {
         if (!isset($this->classSchemata[$childClassName]) || $this->classSchemata[$childClassName]->isAggregateRoot()) {
             continue;
         }
         $this->classSchemata[$childClassName]->setRepositoryClassName($classSchema->getRepositoryClassName());
         $this->makeChildClassesAggregateRoot($this->classSchemata[$childClassName]);
     }
 }
 /**
  * @test
  */
 public function getUriPatternReturnsBasedOnTheIdentityPropertiesOfTheObjectTypeIfNoPatternWasSpecified()
 {
     $this->mockClassSchema->expects($this->once())->method('getIdentityProperties')->will($this->returnValue(array('property1' => 'string', 'property2' => 'integer', 'property3' => 'DateTime')));
     $this->identityRoutePart->setObjectType('SomeObjectType');
     $this->assertSame('{property1}/{property2}/{property3}', $this->identityRoutePart->getUriPattern());
 }
 /**
  * Process an array of object data properties and add identifiers to fetch
  * for recursive processing in nested objects
  *
  * @param array &$properties
  * @param array &$identifiersToFetch
  * @param array &$knownObjects
  * @param \TYPO3\Flow\Reflection\ClassSchema $classSchema
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 protected function processResultProperties(array &$properties, array &$identifiersToFetch, array &$knownObjects, ClassSchema $classSchema)
 {
     foreach ($properties as $propertyName => &$propertyData) {
         // Skip unknown properties
         if (!$classSchema->hasProperty($propertyName)) {
             continue;
         }
         $propertyMetadata = $classSchema->getProperty($propertyName);
         if (!$propertyData['multivalue']) {
             if (isset($propertyData['value']['identifier']) && !isset($propertyData['value']['classname'])) {
                 if ($propertyMetadata['lazy'] !== TRUE) {
                     if (!isset($knownObjects[$propertyData['value']['identifier']])) {
                         $identifiersToFetch[$propertyData['value']['identifier']] = NULL;
                         $propertyData['value'] =& $identifiersToFetch[$propertyData['value']['identifier']];
                     }
                 } else {
                     $propertyData['value'] = array('identifier' => $propertyData['value']['identifier'], 'classname' => $propertyData['type'], 'properties' => array());
                 }
             } elseif (is_array($propertyData['value']) && isset($propertyData['value']['properties'])) {
                 $this->processResultProperties($propertyData['value']['properties'], $identifiersToFetch, $knownObjects, $this->reflectionService->getClassSchema($propertyData['value']['classname']));
             }
         } else {
             for ($index = 0; $index < count($propertyData['value']); $index++) {
                 if (isset($propertyData['value'][$index]['value']['identifier']) && !isset($propertyData['value'][$index]['value']['classname'])) {
                     if ($propertyMetadata['lazy'] !== TRUE) {
                         if (!isset($knownObjects[$propertyData['value'][$index]['value']['identifier']])) {
                             $identifiersToFetch[$propertyData['value'][$index]['value']['identifier']] = NULL;
                             $propertyData['value'][$index]['value'] =& $identifiersToFetch[$propertyData['value'][$index]['value']['identifier']];
                         }
                     } else {
                         $propertyData['value'][$index]['value'] = array('identifier' => $propertyData['value'][$index]['value']['identifier'], 'classname' => $propertyData['value'][$index]['type'], 'properties' => array());
                     }
                 } elseif (is_array($propertyData['value']) && isset($propertyData['value'][$index]['value']['properties']) && is_array($propertyData['value'][$index]['value'])) {
                     $this->processResultProperties($propertyData['value'][$index]['value']['properties'], $identifiersToFetch, $knownObjects, $this->reflectionService->getClassSchema($propertyData['value'][$index]['value']['classname']));
                 }
             }
         }
     }
 }