Return a particular property index

@param ValueInterface[] $propertyValues Property values
@param int $index                       Property value index

@return ValueInterface|ItemInterface
516972
protected function getPropertyIndex(array $propertyValues, $index)
    {
        // If the property value index is out of bounds
        if (!isset($propertyValues[$index])) {
            throw new OutOfBoundsException(
                sprintf(OutOfBoundsException::INVALID_PROPERTY_VALUE_INDEX_STR, $index),
                OutOfBoundsException::INVALID_PROPERTY_VALUE_INDEX
            );
        }

        return $this->getPropertyValue($propertyValues[$index]);
    }
906362
protected function saveSimpleProperty($propertyValues)
    {
        $propertyMap = tao_helpers_form_GenerisFormFactory::getPropertyMap();
        $property = $this->getProperty(tao_helpers_Uri::decode($propertyValues['uri']));
        $type = $propertyValues['type'];
        $range = (isset($propertyValues['range']) ? tao_helpers_Uri::decode(trim($propertyValues['range'])) : null);
        unset($propertyValues['uri']);
        unset($propertyValues['type']);
        unset($propertyValues['range']);
        $rangeNotEmpty = false;
        $values = array(
            ValidationRuleRegistry::PROPERTY_VALIDATION_RULE => array()
        );

        if (isset($propertyMap[$type])) {
            $values[WidgetRdf::PROPERTY_WIDGET] = $propertyMap[$type]['widget'];
            $rangeNotEmpty = ($propertyMap[$type]['range'] === OntologyRdfs::RDFS_RESOURCE  );
        }

        foreach($propertyValues as $key => $value){
            if (is_string($value)) {
                $values[tao_helpers_Uri::decode($key)] = tao_helpers_Uri::decode($value);
            } elseif (is_array($value)) {
                $values[tao_helpers_Uri::decode($key)] = $value;
            } else {
                $this->logWarning('Unsuported value type '.gettype($value));
            }
        }

        $rangeValidator = new tao_helpers_form_validators_NotEmpty(array('message' => __('Range field is required')));
        if($rangeNotEmpty && !$rangeValidator->evaluate($range)){
            throw new Exception($rangeValidator->getMessage());
        }

        $this->bindProperties($property, $values);

        // set the range
        $property->removePropertyValues($this->getProperty(OntologyRdfs::RDFS_RANGE));
        if(!empty($range)) {
            $property->setRange($this->getClass($range));
        } elseif (isset($propertyMap[$type]) && !empty($propertyMap[$type]['range'])) {
            $property->setRange($this->getClass($propertyMap[$type]['range']));
        }

        // set cardinality
        if(isset($propertyMap[$type]['multiple'])) {
            $property->setMultiple($propertyMap[$type]['multiple'] == GenerisRdf::GENERIS_TRUE);
        }
    }
1163453
public static function indexToQuads(array $index) {
    $quads = array();
    foreach ($index as $subject => $predicates) {
      foreach ($predicates as $predicate => $objects) {
        foreach ($objects as $object) {
          $quads[] = new Quad(new IRI($subject),
            new IRI($predicate),
            ($object['type']!='literal')
              ? new IRI($object['value']) : new TypedValue($object['value'],
            (isset($object['datatype']) && $object['datatype']!='')
              ? $object['datatype'] : RdfConstants::XSD_STRING));
        }
      }
    }
    return $quads;
  }
1071782
protected function convertValue($propertyValue, $dataType)
    {
        $parsedType = TypeHandling::parseType($dataType);

        // This hardcoded handling is to circumvent rewriting PropertyMappers that convert objects. Usually they expect the source to be an object already and break if not.
        if (!TypeHandling::isSimpleType($parsedType['type']) && !is_object($propertyValue) && !is_array($propertyValue)) {
            return null;
        }

        $conversionTargetType = $parsedType['type'];
        if (!TypeHandling::isSimpleType($parsedType['type'])) {
            $conversionTargetType = 'array';
        }
        // Technically the "string" hardcoded here is irrelevant as the configured type converter wins, but it cannot be the "elementType"
        // because if the source is of the type $elementType then the PropertyMapper skips the type converter.
        if ($parsedType['type'] === 'array' && $parsedType['elementType'] !== null) {
            $conversionTargetType .= '<' . (TypeHandling::isSimpleType($parsedType['elementType']) ? $parsedType['elementType'] : 'string') . '>';
        }

        $propertyMappingConfiguration = $this->createConfiguration($dataType);
        $convertedValue = $this->propertyMapper->convert($propertyValue, $conversionTargetType, $propertyMappingConfiguration);
        if ($convertedValue instanceof \Neos\Error\Messages\Error) {
            throw new PropertyException($convertedValue->getMessage(), $convertedValue->getCode());
        }

        return $convertedValue;
    }
841168
public function setPropertiesValues($propertiesValues)
    {
        $returnValue = (bool) false;
        $returnValue = $this->getImplementation()->setPropertiesValues($this, $propertiesValues);
        $this->onUpdate();
        return (bool) $returnValue;
    }
176897
protected function getValue($index)
    {
        if ($this->values[$index] === null) {
            return null;
        }
        return $this->values[$index]->value;
    }
1215035
public function getObjectsByPropertyValueBetween($property, $valueA, $valueB, array $select, $objectType = NULL, $objectURI = NULL, $objectId = NULL)
    {

        if (empty($property) || empty($valueA) || empty($valueB) || empty($select))
            return false; //We must have eactly one property value pair defined 

        $query = static::getObjectQuery($select, "?{$this->valueGroup}property_values", $objectId, $objectType, $objectURI);

        $query .= "\nGROUP BY o.object_id";
        $query .= "\nHAVING {$property} BETWEEN {$valueA} AND {$valueB}"; //@TODO check if we are comparing dates and use CAST() to convert to dates 


        $results = $this->database->prepare($query)->execute();

        return $results;
    }
609786
private function resolveTimeValues($valueOrValues)
    {
        if (!is_array($valueOrValues)) {
            return $this->resolveTimeValue($valueOrValues);
        }

        $returnValues = [];

        foreach ($valueOrValues as $key => $value) {
            $returnValues[$key] = $this->resolveTimeValue($value);
        }

        return $returnValues;
    }
52547
public static function getArrayBaseValue($index, $default = [])
    {
        $values = (array) self::getCustom($index, []);

        return array_merge((array) self::get($index, $default), $values);
    }
892473
public function getDevicesByProperty($propertyName, $propertyValue, $caseSensitive=true)
    {

        if ($caseSensitive) {
            $caseSensitive = "";
        }
        else {
            $caseSensitive = "i";
        }

        $devices = $this->getDevices();

        $matchedDevices = [];

        foreach ($devices->device as $device) {

            if (preg_match("/{$propertyValue}/{$caseSensitive}", $device->{$propertyName})) {

                $matchedDevices[] = $device;

            }

        }

        return $matchedDevices;

    }
1082738
protected function getIdsForProperties(array $properties)
    {
        $browserPropertyIds = [];

        foreach ($properties as $propertyKey => $propertyValue) {
            if ($propertyKey === 'Parent') {
                continue;
            }
            if (!array_key_exists($propertyKey, $this->propertyNames)) {
                $propertyKeyId = $this->getNextId('property_key');
                $this->propertyNames[$propertyKey] = $propertyKeyId;

                $this->statements['propertyKey']->execute([
                    'id' => $propertyKeyId,
                    'key' => $propertyKey,
                ]);
            }

            if (!array_key_exists($propertyValue, $this->propertyValues)) {
                $propertyValueId = $this->getNextId('property_value');
                $this->propertyValues[$propertyValue] = $propertyValueId;

                $this->statements['propertyValue']->execute([
                    'id' => $propertyValueId,
                    'value' => $propertyValue,
                ]);
            }

            $propertyKeyId = $this->propertyNames[$propertyKey];
            $propertyValueId = $this->propertyValues[$propertyValue];

            $browserPropertyIds[$propertyKeyId] = $propertyValueId;
        }

        return $browserPropertyIds;
    }
34672
public function getValueFromIndex( $index )
	{
		$dimension	= $this->getDimension();
		if( $index < 0 )
			throw new OutOfRangeException( 'Vector Index ('.$index.') must be greater than 0.' );
		if( $index >= $dimension )
			throw new OutOfRangeException( 'Vector Index ('.$index.') must be lower than Vector Dimension ('.$dimension.').' );
		return $this->values[$index];
	}
535397
public function parse($propertyValue)
    {
        $return = $this->cloneValue($propertyValue);
        $return = $this->createInstanceOfTypeFromValue($return);
        $return = $this->runFilters($return);
        $this->validate($return);

        return $return;
    }
1044642
public function getMapping($index, $type)
    {
        $mappings = $this->getMappings($index);

        if (!isset($mappings[$type])) {
            return null;
        }

        if (!isset($mappings[$type]['properties'])) {
            return [];
        }

        return $mappings[$type]['properties'];
    }
450263
public function getDefault($index, ValueInterface $default = null)
    {
        if (!$this->has($index)) {
            return $default;
        }

        return $this->value[$index];
    }
995434
public function getFiltersTargetedArgs($index = 0)
    {
        return $this->propertyFilters !== null ? $this->propertyFilters->getFiltersTargetedArgs($index) : null;
    }
909444
protected static function getIndexes(array $properties)
    {
        $indexes = [];

        foreach ($properties as $property) {
            $indexes[] = Index::get($property);
        }

        return $indexes;
    }