/**
* Protected constructor
*
- * @param $class Name of the real class (not BaseFactory)
* @return void
*/
protected function __construct () {
// Set object description
$this->setObjectDescription("Simple generic object factory");
+
+ // Create unique ID number
+ $this->createUniqueID();
}
/**
throw new EmptyVariableException(array($factoryInstance, 'className'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif (!class_exists($className)) {
// Then throw an exception
- throw new ClassNotFoundException($className, self::EXCEPTION_CLASS_NOT_FOUND);
+ throw new ClassNotFoundException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND);
}
// Then Prepare the eval() command
// Return the prepared instance
return $objectInstance;
}
+
+ /**
+ * Creates an object by it's configured name
+ *
+ * @param $configEnttry Configuration entry to read
+ * @return $objectInstance An instance of the requested object
+ */
+ public final static function createObjectByConfiguredName ($configEntry) {
+ // Read the configuration entry
+ $className = FrameworkConfiguration::getInstance()->readConfig($configEntry);
+
+ // Send this to the other factory...
+ $objectInstance = self::createObjectByName($className);
+
+ // Return the instance
+ return $objectInstance;
+ }
}
// [EOF]