X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fresolver%2Faction%2Fclass_BaseActionResolver.php;h=b8b701eac4b934bc750d7b6a0cdc32498a4fa84c;hb=49f84a522f0ccac3b70728cd41011a0be0eed8cf;hp=7e462cc5c29f0013d6564a05d433d8a4b5befb92;hpb=c6d73b0e3246efc824cb98338d4be7ee5bc9f308;p=core.git diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php index 7e462cc5..b8b701ea 100644 --- a/inc/classes/main/resolver/action/class_BaseActionResolver.php +++ b/inc/classes/main/resolver/action/class_BaseActionResolver.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @copyright Copyright (c) 2007 - 2009 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -25,12 +25,12 @@ class BaseActionResolver extends BaseResolver { /** * Prefix for local, remote or other resolver */ - private $actionPrefix = ""; + private $actionPrefix = ''; /** * Validated action name */ - private $actionName = ""; + private $actionName = ''; /** * Protected constructor @@ -89,11 +89,11 @@ class BaseActionResolver extends BaseResolver { throw new EmptyVariableException(array($this, 'actionName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); } // END - if + // Create class name + $className = $this->actionPrefix . $this->convertToClassName($actionName) . 'Action'; + // Now, let us create the full name of the action class - $this->setClassName(sprintf("%s%sAction", - $this->actionPrefix, - $this->convertToClassName($actionName) - )); + $this->setClassName($className); // Is this class already loaded? if (class_exists($this->getClassName())) { @@ -118,9 +118,10 @@ class BaseActionResolver extends BaseResolver { $actionInstance = null; // Create action class name - $this->setClassName(sprintf("Web%sAction", - $this->convertToClassName($this->getActionName()) - )); + $className = $this->actionPrefix . $this->convertToClassName($this->getActionName()) . 'Action'; + + // ... and set it + $this->setClassName($className); // Initiate the action $actionInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));