]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/resolver/action/class_BaseActionResolver.php
Renamed classes/main/ to main/classes/ + added FuseFeature, an upcoming feature
[core.git] / inc / classes / main / resolver / action / class_BaseActionResolver.php
diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php
deleted file mode 100644 (file)
index 44836e9..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-<?php
-/**
- * A generic action resolver class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class BaseActionResolver extends BaseResolver {
-       /**
-        * Validated action name
-        */
-       private $actionName = '';
-
-       /**
-        * Protected constructor
-        *
-        * @param       $className      Name of the class
-        * @return      void
-        */
-       protected function __construct ($className) {
-               // Call parent constructor
-               parent::__construct($className);
-       }
-
-       /**
-        * Setter for action name
-        *
-        * @param       $actionName     Last validated action name
-        * @return      void
-        */
-       protected final function setActionName ($actionName) {
-               $this->actionName = (string) $actionName;
-       }
-
-       /**
-        * Getter for action name
-        *
-        * @return      $actionName     Last validated action name
-        */
-       public final function getActionName () {
-               return $this->actionName;
-       }
-
-       /**
-        * Checks whether the given action is valid
-        *
-        * @param       $actionName     The default action we shall execute
-        * @return      $isValid                Whether the given action is valid
-        * @throws      EmptyVariableException  Thrown if given action is not set
-        */
-       public function isActionValid ($actionName) {
-               // By default nothing shall be valid
-               $isValid = FALSE;
-
-               // Is a action set?
-               if (empty($actionName)) {
-                       // Then thrown an exception here
-                       throw new EmptyVariableException(array($this, 'actionName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } // END - if
-
-               // Create class name
-               $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($actionName) . 'Action';
-
-               // Now, let us create the full name of the action class
-               $this->setClassName($className);
-
-               // Is this class already loaded?
-               if (class_exists($this->getClassName())) {
-                       // This class does exist. :-)
-                       $isValid = TRUE;
-               } // END - if
-
-               // Set action name
-               $this->setActionName($actionName);
-
-               // Return the result
-               return $isValid;
-       }
-
-       /**
-        * "Loads" current action and instances it if not yet cached
-        *
-        * @return      $actionInstance                 A loaded action instance
-        */
-       protected function loadAction () {
-               // Init action instance
-               $actionInstance = NULL;
-
-               // Create action class name
-               $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($this->getActionName()) . 'Action';
-
-               // ... and set it
-               $this->setClassName($className);
-
-               // Initiate the action
-               $actionInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
-
-               // Return the result
-               return $actionInstance;
-       }
-}
-
-// [EOF]
-?>