public function setPropertiesValues( core_kernel_classes_Resource $resource, $properties)
    {
        $returnValue = (bool) false;

    	if (is_array($properties) && count($properties) > 0) {
        		
            $session = $this->getServiceLocator()->get(SessionService::SERVICE_ID)->getCurrentSession();
            $platform = $this->getPersistence()->getPlatForm();

            $valuesToInsert = [];

            foreach ($properties as $propertyUri => $value) {
                
                $property = new core_kernel_classes_Property($propertyUri);
                
                $lang = ($property->isLgDependent() ? $session->getDataLanguage() : '');
                $formatedValues = [];
                
                if ($value instanceof core_kernel_classes_Resource) {
                    $formatedValues[] = $value->getUri();
                    
                } elseif (is_array($value)) {
                    foreach($value as $val){
                        $formatedValues[] = ($val instanceof core_kernel_classes_Resource) ? $val->getUri() : $val;
                    }
                } else {
                    $formatedValues[] = ($value == null) ? '' : $value;
                }
                
                foreach ($formatedValues as $object) {
                    $valuesToInsert[] = [
                        'modelid' => $this->getNewTripleModelId(),
                        'subject' => $resource->getUri(),
                        'predicate' => $property->getUri(),
                        'object' => $object,
                        'l_language' => $lang,
                        'author' => $session->getUser()->getIdentifier(),
                        'epoch' => $platform->getNowExpression()
                    ];
                }
            }

            $returnValue = $this->getPersistence()->insertMultiple('statements', $valuesToInsert);
        }
        
        return (bool) $returnValue;
    }
public function setPropertiesValues( core_kernel_classes_Resource $resource, $properties)
    {
        $returnValue = (bool) false;

    	if (is_array($properties) && count($properties) > 0) {
        		
            $session = $this->getServiceLocator()->get(SessionService::SERVICE_ID)->getCurrentSession();
            $platform = $this->getPersistence()->getPlatForm();

            $valuesToInsert = [];

            foreach ($properties as $propertyUri => $value) {
                
                $property = new core_kernel_classes_Property($propertyUri);
                
                $lang = ($property->isLgDependent() ? $session->getDataLanguage() : '');
                $formatedValues = [];
                
                if ($value instanceof core_kernel_classes_Resource) {
                    $formatedValues[] = $value->getUri();
                    
                } elseif (is_array($value)) {
                    foreach($value as $val){
                        $formatedValues[] = ($val instanceof core_kernel_classes_Resource) ? $val->getUri() : $val;
                    }
                } else {
                    $formatedValues[] = ($value == null) ? '' : $value;
                }
                
                foreach ($formatedValues as $object) {
                    $valuesToInsert[] = [
                        'modelid' => $this->getNewTripleModelId(),
                        'subject' => $resource->getUri(),
                        'predicate' => $property->getUri(),
                        'object' => $object,
                        'l_language' => $lang,
                        'author' => $session->getUser()->getIdentifier(),
                        'epoch' => $platform->getNowExpression()
                    ];
                }
            }

            $returnValue = $this->getPersistence()->insertMultiple('statements', $valuesToInsert);
        }
        
        return (bool) $returnValue;
    }
public function setPropertiesValues ( core_kernel_classes_Resource $ resource , $ properties ) { $ returnValue = ( bool ) false ; if ( is_array ( $ properties ) && count ( $ properties ) > 0 ) { $ session = $ this -> getServiceLocator ( ) -> get ( SessionService :: SERVICE_ID ) -> getCurrentSession ( ) ; $ platform = $ this -> getPersistence ( ) -> getPlatForm ( ) ; $ valuesToInsert = [ ] ; foreach ( $ properties as $ propertyUri => $ value ) { $ property = new core_kernel_classes_Property ( $ propertyUri ) ; $ lang = ( $ property -> isLgDependent ( ) ? $ session -> getDataLanguage ( ) : '' ) ; $ formatedValues = [ ] ; if ( $ value instanceof core_kernel_classes_Resource ) { $ formatedValues [ ] = $ value -> getUri ( ) ; } elseif ( is_array ( $ value ) ) { foreach ( $ value as $ val ) { $ formatedValues [ ] = ( $ val instanceof core_kernel_classes_Resource ) ? $ val -> getUri ( ) : $ val ; } } else { $ formatedValues [ ] = ( $ value == null ) ? '' : $ value ; } foreach ( $ formatedValues as $ object ) { $ valuesToInsert [ ] = [ 'modelid' => $ this -> getNewTripleModelId ( ) , 'subject' => $ resource -> getUri ( ) , 'predicate' => $ property -> getUri ( ) , 'object' => $ object , 'l_language' => $ lang , 'author' => $ session -> getUser ( ) -> getIdentifier ( ) , 'epoch' => $ platform -> getNowExpression ( ) ] ; } } $ returnValue = $ this -> getPersistence ( ) -> insertMultiple ( 'statements' , $ valuesToInsert ) ; } return ( bool ) $ returnValue ; }
Short description of method setPropertiesValues

@access public
@author Joel Bout, <joel.bout@tudor.lu>
@param  Resource resource
@param  array properties
@return boolean
Short description of method setPropertiesValues