public static function getClassProperties( core_kernel_classes_Class $clazz,  core_kernel_classes_Class $topLevelClazz = null)
    {
        $returnValue = array();




        if(is_null($topLevelClazz)){
			$topLevelClazz = new core_kernel_classes_Class(TaoOntology::CLASS_URI_OBJECT );
		}


		if($clazz->getUri() == $topLevelClazz->getUri()){
			$returnValue = $clazz->getProperties(false);
			return (array) $returnValue;
		}

		//determine the parent path
		$parents = array();
		$top = false;
		do{
			if(!isset($lastLevelParents)){
				$parentClasses = $clazz->getParentClasses(false);
			}
			else{
				$parentClasses = array();
				foreach($lastLevelParents as $parent){
					$parentClasses = array_merge($parentClasses, $parent->getParentClasses(false));
				}
			}
			if(count($parentClasses) == 0){
				break;
			}
			$lastLevelParents = array();
			foreach($parentClasses as $parentClass){
				if($parentClass->getUri() == OntologyRdfs::RDFS_CLASS){
					continue;
				}
				if($parentClass->getUri() == $topLevelClazz->getUri() ) {
					$parents[$parentClass->getUri()] = $parentClass;
					$top = true;
					break;
				}


				$allParentClasses = $parentClass->getParentClasses(true);
				if(array_key_exists($topLevelClazz->getUri(), $allParentClasses)){
					 $parents[$parentClass->getUri()] = $parentClass;
				}

				$lastLevelParents[$parentClass->getUri()] = $parentClass;
			}
		}while(!$top);

		foreach($parents as $parent){
			$returnValue = array_merge($returnValue, $parent->getProperties(false));
    	}
    	$returnValue = array_merge($returnValue, $clazz->getProperties(false));



        return (array) $returnValue;
    }
public static function getClassProperties( core_kernel_classes_Class $clazz,  core_kernel_classes_Class $topLevelClazz = null)
    {
        $returnValue = array();




        if(is_null($topLevelClazz)){
			$topLevelClazz = new core_kernel_classes_Class(TaoOntology::CLASS_URI_OBJECT );
		}


		if($clazz->getUri() == $topLevelClazz->getUri()){
			$returnValue = $clazz->getProperties(false);
			return (array) $returnValue;
		}

		//determine the parent path
		$parents = array();
		$top = false;
		do{
			if(!isset($lastLevelParents)){
				$parentClasses = $clazz->getParentClasses(false);
			}
			else{
				$parentClasses = array();
				foreach($lastLevelParents as $parent){
					$parentClasses = array_merge($parentClasses, $parent->getParentClasses(false));
				}
			}
			if(count($parentClasses) == 0){
				break;
			}
			$lastLevelParents = array();
			foreach($parentClasses as $parentClass){
				if($parentClass->getUri() == OntologyRdfs::RDFS_CLASS){
					continue;
				}
				if($parentClass->getUri() == $topLevelClazz->getUri() ) {
					$parents[$parentClass->getUri()] = $parentClass;
					$top = true;
					break;
				}


				$allParentClasses = $parentClass->getParentClasses(true);
				if(array_key_exists($topLevelClazz->getUri(), $allParentClasses)){
					 $parents[$parentClass->getUri()] = $parentClass;
				}

				$lastLevelParents[$parentClass->getUri()] = $parentClass;
			}
		}while(!$top);

		foreach($parents as $parent){
			$returnValue = array_merge($returnValue, $parent->getProperties(false));
    	}
    	$returnValue = array_merge($returnValue, $clazz->getProperties(false));



        return (array) $returnValue;
    }
public static function getClassProperties ( core_kernel_classes_Class $ clazz , core_kernel_classes_Class $ topLevelClazz = null ) { $ returnValue = array ( ) ; if ( is_null ( $ topLevelClazz ) ) { $ topLevelClazz = new core_kernel_classes_Class ( TaoOntology :: CLASS_URI_OBJECT ) ; } if ( $ clazz -> getUri ( ) == $ topLevelClazz -> getUri ( ) ) { $ returnValue = $ clazz -> getProperties ( false ) ; return ( array ) $ returnValue ; } //determine the parent path $ parents = array ( ) ; $ top = false ; do { if ( ! isset ( $ lastLevelParents ) ) { $ parentClasses = $ clazz -> getParentClasses ( false ) ; } else { $ parentClasses = array ( ) ; foreach ( $ lastLevelParents as $ parent ) { $ parentClasses = array_merge ( $ parentClasses , $ parent -> getParentClasses ( false ) ) ; } } if ( count ( $ parentClasses ) == 0 ) { break ; } $ lastLevelParents = array ( ) ; foreach ( $ parentClasses as $ parentClass ) { if ( $ parentClass -> getUri ( ) == OntologyRdfs :: RDFS_CLASS ) { continue ; } if ( $ parentClass -> getUri ( ) == $ topLevelClazz -> getUri ( ) ) { $ parents [ $ parentClass -> getUri ( ) ] = $ parentClass ; $ top = true ; break ; } $ allParentClasses = $ parentClass -> getParentClasses ( true ) ; if ( array_key_exists ( $ topLevelClazz -> getUri ( ) , $ allParentClasses ) ) { $ parents [ $ parentClass -> getUri ( ) ] = $ parentClass ; } $ lastLevelParents [ $ parentClass -> getUri ( ) ] = $ parentClass ; } } while ( ! $ top ) ; foreach ( $ parents as $ parent ) { $ returnValue = array_merge ( $ returnValue , $ parent -> getProperties ( false ) ) ; } $ returnValue = array_merge ( $ returnValue , $ clazz -> getProperties ( false ) ) ; return ( array ) $ returnValue ; }
Enable you to get the properties of a class.
The advantage of this method is to limit the level of recusrivity in the
It get the properties up to the defined top class

@access public
@author Bertrand Chevrier, <bertrand.chevrier@tudor.lu>
@param  core_kernel_classes_Class $clazz
@param  core_kernel_classes_Class $topLevelClazz
@return array
Enable you to get the properties of a class . The advantage of this method is to limit the level of recusrivity in the It get the properties up to the defined top class