*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
*/
private $commandName = "";
- /**
- * A controller instance
- */
- private $controllerInstance = null;
-
/**
* Protected constructor
*
+ * @param $className Name of the class
* @return void
*/
protected function __construct ($className) {
return $this->commandName;
}
- /**
- * Setter for controller instance (this surely breaks a bit the MVC patterm)
- *
- * @param $controllerInstance An instance of the controller
- * @return void
- */
- public final function setControllerInstance (Controller $controllerInstance) {
- $this->controllerInstance = $controllerInstance;
- }
-
- /**
- * Getter for controller instance (this surely breaks a bit the MVC patterm)
- *
- * @return $controllerInstance An instance of the controller
- */
- public final function getControllerInstance () {
- return $this->controllerInstance;
- }
-
/**
* Checks wether the given command is valid
*
* @param $commandName The default command we shall execute
* @return $isValid Wether the given command is valid
- * @throws EmptyVariableException Thrown if the given command is not set
+ * @throws EmptyVariableException Thrown if given command is not set
*/
public function isCommandValid ($commandName) {
// By default nothing shall be valid
}
// Now, let us create the full name of the command class
- $className = sprintf("%s%sCommand",
+ $this->setClassName(sprintf("%s%sCommand",
$this->commandPrefix,
$this->convertToClassName($commandName)
- );
+ ));
// Is this class already loaded?
- if (class_exists($className)) {
+ if (class_exists($this->getClassName())) {
// This class does exist. :-)
$isValid = true;
} // END - if
- // Debug output
- //* DEBUG: */ $this->debugBacktrace();
-
// Set command name
$this->setCommandName($commandName);