Creates a new object given by the name or throws an exception if the class was not found. No parameters for the object are currently supported.
Definition at line 51 of file class_ObjectFactory.php. Referenced by WorksContract.addContractDetails(), ApplicationEntryPoint.app_die(), CompressorChannel.createCompressorChannel(), CacheFactory.createConfiguredCache(), DebugMiddleware.createDebugMiddleware(), WebNewsFactory.createFactoryByRequest(), BaseShip.createShipPart(), WorksContract.createWorksContract(), ApplicationHelper.entryPoint(), UserAuthFilter.execute(), ShipSimuLoginHelper.executeLogin(), AdminLoginHelper.executeLogin(), BaseActionResolver.loadAction(), WebCommandResolver.loadCommand(), ImageCommandResolver.loadCommand(), WebGovernmentFailedCommandResolver.loadCommand(), WebControllerResolver.loadController(), ImageControllerResolver.loadController(), and ImageTemplateEngine.setImageType(). 00051 { 00052 // Is the class name valid and is the class there? 00053 if (empty($className)) { 00054 // First get an instance of this factory 00055 $factoryInstance = new ObjectFactory(); 00056 00057 // Throw an exception here 00058 throw new EmptyVariableException(array($factoryInstance, 'className'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); 00059 } elseif (!class_exists($className)) { 00060 // First get an instance of this factory 00061 $factoryInstance = new ObjectFactory(); 00062 00063 // Then throw an exception 00064 throw new ClassNotFoundException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND); 00065 } 00066 00067 // Create method name 00068 $methodName = sprintf("create%s", 00069 $className 00070 ); 00071 00072 // Run the user function 00073 $objectInstance = call_user_func_array(array($className, $methodName), $args); 00074 00075 // Count generated objects up 00076 self::$total++; 00077 00078 // Return the prepared instance 00079 return $objectInstance; 00080 }
Here is the caller graph for this function:
![]()
|
1.5.6