public static function catchItemRdfUpdatedEvent(ItemRdfUpdatedEvent $event) {
        $rdfItem = new core_kernel_classes_Resource($event->getItemUri());
        $type = $rdfItem->getProperty(taoItems_models_classes_ItemsService::PROPERTY_ITEM_MODEL);
        /*@var $directory \oat\oatbox\filesystem\Directory */
        $directory = taoItems_models_classes_ItemsService::singleton()->getItemDirectory($rdfItem);
        $itemModel = $rdfItem->getPropertyValues($type);
        if($directory->exists() && in_array(taoItems_models_classes_itemModel::CLASS_URI_QTI, $itemModel)  ) {
            /* @var $file File */
            $file = $directory->getFile(Service::QTI_ITEM_FILE);
                
            $qtiParser = new Parser($file->read());
            $qtiItem = $qtiParser->load();
            $label = mb_substr($rdfItem->getLabel(), 0, 256, 'UTF-8');
            $qtiItem->setAttribute('label', $label);
            $file->put($qtiItem->toXML());
        }
        
    }
public static function catchItemRdfUpdatedEvent(ItemRdfUpdatedEvent $event) {
        $rdfItem = new core_kernel_classes_Resource($event->getItemUri());
        $type = $rdfItem->getProperty(taoItems_models_classes_ItemsService::PROPERTY_ITEM_MODEL);
        /*@var $directory \oat\oatbox\filesystem\Directory */
        $directory = taoItems_models_classes_ItemsService::singleton()->getItemDirectory($rdfItem);
        $itemModel = $rdfItem->getPropertyValues($type);
        if($directory->exists() && in_array(taoItems_models_classes_itemModel::CLASS_URI_QTI, $itemModel)  ) {
            /* @var $file File */
            $file = $directory->getFile(Service::QTI_ITEM_FILE);
                
            $qtiParser = new Parser($file->read());
            $qtiItem = $qtiParser->load();
            $label = mb_substr($rdfItem->getLabel(), 0, 256, 'UTF-8');
            $qtiItem->setAttribute('label', $label);
            $file->put($qtiItem->toXML());
        }
        
    }
public static function catchItemRdfUpdatedEvent ( ItemRdfUpdatedEvent $ event ) { $ rdfItem = new core_kernel_classes_Resource ( $ event -> getItemUri ( ) ) ; $ type = $ rdfItem -> getProperty ( taoItems_models_classes_ItemsService :: PROPERTY_ITEM_MODEL ) ; /*@var $directory \oat\oatbox\filesystem\Directory */ $ directory = taoItems_models_classes_ItemsService :: singleton ( ) -> getItemDirectory ( $ rdfItem ) ; $ itemModel = $ rdfItem -> getPropertyValues ( $ type ) ; if ( $ directory -> exists ( ) && in_array ( taoItems_models_classes_itemModel :: CLASS_URI_QTI , $ itemModel ) ) { /* @var $file File */ $ file = $ directory -> getFile ( Service :: QTI_ITEM_FILE ) ; $ qtiParser = new Parser ( $ file -> read ( ) ) ; $ qtiItem = $ qtiParser -> load ( ) ; $ label = mb_substr ( $ rdfItem -> getLabel ( ) , 0 , 256 , 'UTF-8' ) ; $ qtiItem -> setAttribute ( 'label' , $ label ) ; $ file -> put ( $ qtiItem -> toXML ( ) ) ; } }
synchronise item label
@param ItemRdfUpdatedEvent $event
synchronise item label