3 namespace Org\Mxchange\CoreFramework\Application;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Controller\Controller;
7 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
8 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
9 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
12 * A general application class for the ApplicationHelper classes.
14 * @author Roland Haeder <webmaster@shipsimu.org>
16 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
17 * @license GNU GPL 3.0 or any newer version
18 * @link http://www.shipsimu.org
20 * This program is free software: you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation, either version 3 of the License, or
23 * (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program. If not, see <http://www.gnu.org/licenses/>.
33 abstract class BaseApplication extends BaseFrameworkSystem {
35 * The version number of this application
37 private $appVersion = '';
40 * The human-readable name for this application
42 private $appName = '';
45 * The short uni*-like name for this application
47 private $shortName = '';
50 * Own singleton instance of this application helper
52 private static $applicationInstance = NULL;
55 * A controller instance
57 private $controllerInstance = NULL;
60 * Protected constructor
62 * @param $className Name of the class
65 protected function __construct (string $className) {
66 // Call parent constructor
67 parent::__construct($className);
71 * Getter for own instance
73 * @return $applicationInstance An instance of a ManageableApplication class
75 public static final function getApplicationInstance () {
76 return self::$applicationInstance;
80 * Setter for own instance
82 * @param $applicationInstance An instance of a ManageableApplication class
84 public static final function setApplicationInstance (ManageableApplication $applicationInstance) {
85 self::$applicationInstance = $applicationInstance;
89 * Setter for controller instance (this surely breaks a bit the MVC patterm)
91 * @param $controllerInstance An instance of the controller
94 public final function setControllerInstance (Controller $controllerInstance) {
95 $this->controllerInstance = $controllerInstance;
99 * Getter for controller instance (this surely breaks a bit the MVC patterm)
101 * @return $controllerInstance An instance of the controller
103 public final function getControllerInstance () {
104 return $this->controllerInstance;
108 * Getter for the version number
110 * @return $appVersion The application's version number
112 public final function getAppVersion () {
113 return $this->appVersion;
117 * Setter for the version number
119 * @param $appVersion The application's version number
122 public final function setAppVersion (string $appVersion) {
124 $this->appVersion = $appVersion;
128 * Getter for human-readable name
130 * @return $appName The application's human-readable name
132 public final function getAppName () {
133 return $this->appName;
137 * Setter for human-readable name
139 * @param $appName The application's human-readable name
142 public final function setAppName (string $appName) {
144 $this->appName = $appName;;
148 * Getter for short uni*-like name
150 * @return $shortName The application's short uni*-like name
152 public final function getAppShortName () {
153 return $this->shortName;
157 * Setter for short uni*-like name
159 * @param $shortName The application's short uni*-like name
162 public final function setAppShortName (string $shortName) {
164 $this->shortName = $shortName;