private static function getAvailableLangs()
    {
        //get it into the api only once 
        if(count(self::$availableLangs) == 0){
        	try {
        		self::$availableLangs = common_cache_FileCache::singleton()->get(self::AVAILABLE_LANGS_CACHEKEY);
        	} catch (common_cache_NotFoundException $e) {
	        	$langClass = new core_kernel_classes_Class(tao_models_classes_LanguageService::CLASS_URI_LANGUAGES);
	        	$valueProperty = new core_kernel_classes_Property(OntologyRdf::RDF_VALUE);
	        	foreach($langClass->getInstances() as $lang){
	        	    $values = $lang->getPropertiesValues(array(
                        OntologyRdf::RDF_VALUE,
                        tao_models_classes_LanguageService::PROPERTY_LANGUAGE_USAGES,
                        tao_models_classes_LanguageService::PROPERTY_LANGUAGE_ORIENTATION
					));
	        	    if (count($values[OntologyRdf::RDF_VALUE]) != 1) {
	        	        throw new common_exception_InconsistentData('Error with value of language '.$lang->getUri());
	        	    }
	        	    $value = current($values[OntologyRdf::RDF_VALUE])->__toString();
	        	    $usages = array();
	        	    foreach ($values[tao_models_classes_LanguageService::PROPERTY_LANGUAGE_USAGES] as $usage) {
	        	        $usages[] = $usage->getUri();
	        	    }
	        	    if (count($values[tao_models_classes_LanguageService::PROPERTY_LANGUAGE_ORIENTATION]) != 1) {
	        	        common_Logger::w('Error with orientation of language '.$lang->getUri());
	        	        $orientation = tao_models_classes_LanguageService::INSTANCE_ORIENTATION_LTR;
	        	    } else {
                        $orientation = current($values[tao_models_classes_LanguageService::PROPERTY_LANGUAGE_ORIENTATION ])->getUri();
	        	    }
	        	    self::$availableLangs[$value] = array(
	        	        'uri'                         => $lang->getUri(),
                        tao_models_classes_LanguageService::PROPERTY_LANGUAGE_USAGES      => $usages,
                        tao_models_classes_LanguageService::PROPERTY_LANGUAGE_ORIENTATION  => $orientation
	        	    );
	        	}
	        	common_cache_FileCache::singleton()->put(self::$availableLangs, self::AVAILABLE_LANGS_CACHEKEY);
        	}
        }
        
        return self::$availableLangs;
    }
private static function getAvailableLangs()
    {
        //get it into the api only once 
        if(count(self::$availableLangs) == 0){
        	try {
        		self::$availableLangs = common_cache_FileCache::singleton()->get(self::AVAILABLE_LANGS_CACHEKEY);
        	} catch (common_cache_NotFoundException $e) {
	        	$langClass = new core_kernel_classes_Class(tao_models_classes_LanguageService::CLASS_URI_LANGUAGES);
	        	$valueProperty = new core_kernel_classes_Property(OntologyRdf::RDF_VALUE);
	        	foreach($langClass->getInstances() as $lang){
	        	    $values = $lang->getPropertiesValues(array(
                        OntologyRdf::RDF_VALUE,
                        tao_models_classes_LanguageService::PROPERTY_LANGUAGE_USAGES,
                        tao_models_classes_LanguageService::PROPERTY_LANGUAGE_ORIENTATION
					));
	        	    if (count($values[OntologyRdf::RDF_VALUE]) != 1) {
	        	        throw new common_exception_InconsistentData('Error with value of language '.$lang->getUri());
	        	    }
	        	    $value = current($values[OntologyRdf::RDF_VALUE])->__toString();
	        	    $usages = array();
	        	    foreach ($values[tao_models_classes_LanguageService::PROPERTY_LANGUAGE_USAGES] as $usage) {
	        	        $usages[] = $usage->getUri();
	        	    }
	        	    if (count($values[tao_models_classes_LanguageService::PROPERTY_LANGUAGE_ORIENTATION]) != 1) {
	        	        common_Logger::w('Error with orientation of language '.$lang->getUri());
	        	        $orientation = tao_models_classes_LanguageService::INSTANCE_ORIENTATION_LTR;
	        	    } else {
                        $orientation = current($values[tao_models_classes_LanguageService::PROPERTY_LANGUAGE_ORIENTATION ])->getUri();
	        	    }
	        	    self::$availableLangs[$value] = array(
	        	        'uri'                         => $lang->getUri(),
                        tao_models_classes_LanguageService::PROPERTY_LANGUAGE_USAGES      => $usages,
                        tao_models_classes_LanguageService::PROPERTY_LANGUAGE_ORIENTATION  => $orientation
	        	    );
	        	}
	        	common_cache_FileCache::singleton()->put(self::$availableLangs, self::AVAILABLE_LANGS_CACHEKEY);
        	}
        }
        
        return self::$availableLangs;
    }
private static function getAvailableLangs ( ) { //get it into the api only once  if ( count ( self :: $ availableLangs ) == 0 ) { try { self :: $ availableLangs = common_cache_FileCache :: singleton ( ) -> get ( self :: AVAILABLE_LANGS_CACHEKEY ) ; } catch ( common_cache_NotFoundException $ e ) { $ langClass = new core_kernel_classes_Class ( tao_models_classes_LanguageService :: CLASS_URI_LANGUAGES ) ; $ valueProperty = new core_kernel_classes_Property ( OntologyRdf :: RDF_VALUE ) ; foreach ( $ langClass -> getInstances ( ) as $ lang ) { $ values = $ lang -> getPropertiesValues ( array ( OntologyRdf :: RDF_VALUE , tao_models_classes_LanguageService :: PROPERTY_LANGUAGE_USAGES , tao_models_classes_LanguageService :: PROPERTY_LANGUAGE_ORIENTATION ) ) ; if ( count ( $ values [ OntologyRdf :: RDF_VALUE ] ) != 1 ) { throw new common_exception_InconsistentData ( 'Error with value of language ' . $ lang -> getUri ( ) ) ; } $ value = current ( $ values [ OntologyRdf :: RDF_VALUE ] ) -> __toString ( ) ; $ usages = array ( ) ; foreach ( $ values [ tao_models_classes_LanguageService :: PROPERTY_LANGUAGE_USAGES ] as $ usage ) { $ usages [ ] = $ usage -> getUri ( ) ; } if ( count ( $ values [ tao_models_classes_LanguageService :: PROPERTY_LANGUAGE_ORIENTATION ] ) != 1 ) { common_Logger :: w ( 'Error with orientation of language ' . $ lang -> getUri ( ) ) ; $ orientation = tao_models_classes_LanguageService :: INSTANCE_ORIENTATION_LTR ; } else { $ orientation = current ( $ values [ tao_models_classes_LanguageService :: PROPERTY_LANGUAGE_ORIENTATION ] ) -> getUri ( ) ; } self :: $ availableLangs [ $ value ] = array ( 'uri' => $ lang -> getUri ( ) , tao_models_classes_LanguageService :: PROPERTY_LANGUAGE_USAGES => $ usages , tao_models_classes_LanguageService :: PROPERTY_LANGUAGE_ORIENTATION => $ orientation ) ; } common_cache_FileCache :: singleton ( ) -> put ( self :: $ availableLangs , self :: AVAILABLE_LANGS_CACHEKEY ) ; } } return self :: $ availableLangs ; }
This method returns the languages available in TAO.

@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@param  boolean langName If set to true, an associative array where keys are language codes and values are language labels. If set to false (default), a simple array of language codes is returned.
@return array
@throws common_exception_InconsistentData
This method returns the languages available in TAO .