src/ADT/PHP/Container.php
public function getClassFromClassName( $className, ADT_PHP_Interface $relatedArtefact )
	{
		if( !isset( $this->classNameList[$className] ) )
			throw new Exception( 'Unknown class "'.$className.'"' );
		$list	= $this->classNameList[$className];
		$category	= $relatedArtefact->getCategory();
		$package	= $relatedArtefact->getPackage();

		if( isset( $list[$category][$package] ) )													//  found Class in same Category same Package
			return $list[$category][$package];														//  return Data Object of Class

		if( isset( $list[$category] ) )																//  found Class in same Category but different Package
			return array_shift( $list[$category] );													//  this is a Guess: return Data Object of guessed Class

		$firstCategory	= array_shift( $list );
		return array_shift( $firstCategory );
	}
public function getClassFromClassName( $className, ADT_PHP_Interface $relatedArtefact )
	{
		if( !isset( $this->classNameList[$className] ) )
			throw new Exception( 'Unknown class "'.$className.'"' );
		$list	= $this->classNameList[$className];
		$category	= $relatedArtefact->getCategory();
		$package	= $relatedArtefact->getPackage();

		if( isset( $list[$category][$package] ) )													//  found Class in same Category same Package
			return $list[$category][$package];														//  return Data Object of Class

		if( isset( $list[$category] ) )																//  found Class in same Category but different Package
			return array_shift( $list[$category] );													//  this is a Guess: return Data Object of guessed Class

		$firstCategory	= array_shift( $list );
		return array_shift( $firstCategory );
	}
public function getClassFromClassName ( $ className , ADT_PHP_Interface $ relatedArtefact ) { if ( ! isset ( $ this -> classNameList [ $ className ] ) ) throw new Exception ( 'Unknown class "' . $ className . '"' ) ; $ list = $ this -> classNameList [ $ className ] ; $ category = $ relatedArtefact -> getCategory ( ) ; $ package = $ relatedArtefact -> getPackage ( ) ; if ( isset ( $ list [ $ category ] [ $ package ] ) ) //  found Class in same Category same Package return $ list [ $ category ] [ $ package ] ; //  return Data Object of Class if ( isset ( $ list [ $ category ] ) ) //  found Class in same Category but different Package return array_shift ( $ list [ $ category ] ) ; //  this is a Guess: return Data Object of guessed Class $ firstCategory = array_shift ( $ list ) ; return array_shift ( $ firstCategory ) ; }
Searches for a Class by its Name in same Category and Package.
Otherwise searches in different Packages and finally in different Categories.
@access		public
@param		string				$className			Name of Class to find Data Object for
@param		ADT_PHP_Interface	$relatedArtefact	A related Class or Interface (for Package and Category Information)
@return		ADT_PHP_Class
@throws		Exception			if Class is not known
Searches for a Class by its Name in same Category and Package . Otherwise searches in different Packages and finally in different Categories .