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);
        }
    }
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);
        }
    }
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 ) ; } }
Default property handling

@param array $propertyValues
Default property handling