public function loadProse(StoryTeller $st, $className, $constructorArgs)
{
// can we find the class?
foreach ($this->namespaces as $namespace) {
// what is the full name of the class (inc namespace) to
// search for?
$namespacedClassName = $namespace . "\\" . $className;
// is there such a class?
if (class_exists($namespacedClassName)) {
// yes there is!!
//
// create an instance of the class
$return = new $namespacedClassName($st, $constructorArgs);
// make sure our new object is an instance of 'Prose'
if (!$return instanceof Prose) {
throw new E5xx_NotAProseClass($namespacedClassName);
}
// return our newly-minted object
return $return;
}
}
// if we get there, then we cannot find a suitable class in
// any of the namespaces that we know about
return null;
}