/**
* A generic action resolver class
*
- * @author Roland Haeder <webmaster@ship-simu.org>
+ * @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
* @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
+ * @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
* 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
*/
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
*
}
/**
- * Checks wether the given action is valid
+ * Checks whether the given action is valid
*
* @param $actionName The default action we shall execute
- * @return $isValid Wether the given action is valid
+ * @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;
+ $isValid = FALSE;
// Is a action set?
if (empty($actionName)) {
} // END - if
// Create class name
- $className = $this->actionPrefix . $this->convertToClassName($actionName) . 'Action';
+ $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;
+ $isValid = TRUE;
} // END - if
// Set action name
*/
protected function loadAction () {
// Init action instance
- $actionInstance = null;
+ $actionInstance = NULL;
// Create action class name
- $className = $this->actionPrefix . $this->convertToClassName($this->getActionName()) . 'Action';
+ $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($this->getActionName()) . 'Action';
// ... and set it
$this->setClassName($className);