]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/resolver/action/class_BaseActionResolver.php
Copyright updated
[core.git] / inc / classes / main / resolver / action / class_BaseActionResolver.php
index 6f4cbd83271cd761c2964ffa1234d5b72ea93a59..37e605bea2abb3ef1768b28ccddf3bbb269e143f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007 - 2009 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseActionResolver extends BaseResolver {
-       /**
-        * Prefix for local, remote or other resolver
-        */
-       private $actionPrefix = "";
-
        /**
         * Validated action name
         */
-       private $actionName = "";
+       private $actionName = '';
 
        /**
         * Protected constructor
@@ -43,16 +38,6 @@ class BaseActionResolver extends BaseResolver {
                parent::__construct($className);
        }
 
-       /**
-        * Setter for action prefix
-        *
-        * @param       $actionPrefix   Last validated actionPrefix
-        * @return      void
-        */
-       protected final function setActionPrefix ($actionPrefix) {
-               $this->actionPrefix = $actionPrefix;
-       }
-
        /**
         * Setter for action name
         *
@@ -89,11 +74,11 @@ class BaseActionResolver extends BaseResolver {
                        throw new EmptyVariableException(array($this, 'actionName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } // END - if
 
+               // Create class name
+               $className = $this->getClassPrefix() . $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 +103,10 @@ class BaseActionResolver extends BaseResolver {
                $actionInstance = null;
 
                // Create action class name
-               $this->setClassName(sprintf("Web%sAction",
-                       $this->convertToClassName($this->getActionName())
-               ));
+               $className = $this->getClassPrefix() . $this->convertToClassName($this->getActionName()) . 'Action';
+
+               // ... and set it
+               $this->setClassName($className);
 
                // Initiate the action
                $actionInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));