From: Roland Haeder Date: Sun, 5 Apr 2015 21:38:05 +0000 (+0200) Subject: Moved some class fields and their setter/getter to BaseFrameworkSystem. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=88deca9fb4d77cdc34fb762070cad57da8cdd5be;p=core.git Moved some class fields and their setter/getter to BaseFrameworkSystem. Signed-off-by: Roland Häder --- diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index a294e8ee..a542b371 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -243,6 +243,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ private $genericArray = array(); + /** + * Command name + */ + private $commandName = ''; + + /** + * Controller name + */ + private $controllerName = ''; + /*********************** * Exception codes.... * ***********************/ @@ -1433,6 +1443,44 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->listenerInstance; } + /** + * Setter for command name + * + * @param $commandName Last validated command name + * @return void + */ + protected final function setCommandName ($commandName) { + $this->commandName = $commandName; + } + + /** + * Getter for command name + * + * @return $commandName Last validated command name + */ + protected final function getCommandName () { + return $this->commandName; + } + + /** + * Setter for controller name + * + * @param $controllerName Last validated controller name + * @return void + */ + protected final function setControllerName ($controllerName) { + $this->controllerName = $controllerName; + } + + /** + * Getter for controller name + * + * @return $controllerName Last validated controller name + */ + protected final function getControllerName () { + return $this->controllerName; + } + /** * Checks whether an object equals this object. You should overwrite this * method to implement own equality checks diff --git a/inc/classes/main/commands/class_BaseCommand.php b/inc/classes/main/commands/class_BaseCommand.php index 05fd5ce6..efb9d16d 100644 --- a/inc/classes/main/commands/class_BaseCommand.php +++ b/inc/classes/main/commands/class_BaseCommand.php @@ -22,11 +22,6 @@ * along with this program. If not, see . */ class BaseCommand extends BaseFrameworkSystem { - /** - * The controller we need for this command - */ - private $controllerName = ''; - /** * Protected constructor * @@ -37,25 +32,6 @@ class BaseCommand extends BaseFrameworkSystem { // Call parent constructor parent::__construct($className); } - - /** - * Setter for controller name - * - * @param $controllerName Name of the controller assigned with this command - * @return void - */ - public final function setControllerName ($controllerName) { - $this->controllerName = (string) $controllerName; - } - - /** - * Getter for controller name - * - * @return $controllerName Name of the controller assigned with this command - */ - public final function getControllerName () { - return $this->controllerName; - } } // [EOF] diff --git a/inc/classes/main/resolver/command/class_BaseCommandResolver.php b/inc/classes/main/resolver/command/class_BaseCommandResolver.php index 0994bf16..283f5558 100644 --- a/inc/classes/main/resolver/command/class_BaseCommandResolver.php +++ b/inc/classes/main/resolver/command/class_BaseCommandResolver.php @@ -22,11 +22,6 @@ * along with this program. If not, see . */ class BaseCommandResolver extends BaseResolver { - /** - * Validated command name - */ - private $commandName = ''; - /** * Protected constructor * @@ -38,25 +33,6 @@ class BaseCommandResolver extends BaseResolver { parent::__construct($className); } - /** - * Setter for command name - * - * @param $commandName Last validated command name - * @return void - */ - protected final function setCommandName ($commandName) { - $this->commandName = $commandName; - } - - /** - * Getter for command name - * - * @return $commandName Last validated command name - */ - protected final function getCommandName () { - return $this->commandName; - } - /** * "Loads" a given command and instances it if not yet cached * diff --git a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php index 03560545..14db8c3e 100644 --- a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php +++ b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php @@ -22,11 +22,6 @@ * along with this program. If not, see . */ class BaseControllerResolver extends BaseResolver { - /** - * Validated controller name - */ - private $controllerName = ''; - /** * Protected constructor * @@ -38,25 +33,6 @@ class BaseControllerResolver extends BaseResolver { parent::__construct($className); } - /** - * Setter for controller name - * - * @param $controllerName Last validated controller name - * @return void - */ - protected final function setControllerName ($controllerName) { - $this->controllerName = $controllerName; - } - - /** - * Getter for controller name - * - * @return $controllerName Last validated controller name - */ - public final function getControllerName () { - return $this->controllerName; - } - /** * "Loads" a given controller and instances it if not yet cached. If the * controller was not found one of the default controllers will be used