3 namespace Org\Mxchange\CoreFramework\Resolver;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
7 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
10 * A generic resolver class
12 * @author Roland Haeder <webmaster@shipsimu.org>
14 <<<<<<< HEAD:framework/main/classes/resolver/class_BaseResolver.php
15 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
17 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
18 >>>>>>> Some updates::inc/main/classes/resolver/class_BaseResolver.php
19 * @license GNU GPL 3.0 or any newer version
20 * @link http://www.shipsimu.org
22 * This program is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
32 * You should have received a copy of the GNU General Public License
33 * along with this program. If not, see <http://www.gnu.org/licenses/>.
35 abstract class BaseResolver extends BaseFrameworkSystem {
39 private $namespace = '';
44 private $className = '';
49 private $classPrefix = '';
52 * (Last) resolved instance
54 private $resolvedInstance = NULL;
56 // Exception constants
57 const EXCEPTION_INVALID_COMMAND = 0x1d0;
58 const EXCEPTION_INVALID_CONTROLLER = 0x1d1;
59 const EXCEPTION_INVALID_ACTION = 0x1d2;
60 const EXCEPTION_INVALID_STATE = 0x1d3;
63 * Protected constructor
65 * @param $className Real name of the class
68 protected function __construct ($className) {
69 // Call parent constructor
70 parent::__construct($className);
74 * Getter for namespace
76 * @return $namespace Namespace to look in
78 public final function getNamespace () {
79 return $this->namespace;
83 * Setter for namespace
85 * @param $namespace Namespace to look in
88 protected final function setNamespace ($namespace) {
89 $this->namespace = (string) $namespace;
93 * Getter for class name
95 * @return $className Name of the class
97 public final function getClassName () {
98 return $this->className;
102 * Setter for class name
104 * @param $className Name of the class
107 protected final function setClassName ($className) {
108 $this->className = (string) $className;
112 * "Getter" for class name (useable for an object factory)
114 * @return $className Capitalized class name
116 protected function getCapitalizedClassPrefix () {
118 $className = $this->getClassPrefix();
121 $className = self::convertToClassName($className);
128 * Getter for class prefix
130 * @return $classPrefix Last validated classPrefix
132 protected final function getClassPrefix () {
133 return $this->classPrefix;
137 * Setter for class prefix
139 * @param $classPrefix Last validated classPrefix
142 protected final function setClassPrefix ($classPrefix) {
143 $this->classPrefix = (string) $classPrefix;
147 * Getter for (last) resolved instance
149 * @return $resolvedInstance Last validated resolvedInstance
151 protected final function getResolvedInstance () {
152 return $this->resolvedInstance;
156 * Setter for (last) resolved instance
158 * @param $resolvedInstance (Last) validated resolved instance
161 protected final function setResolvedInstance (FrameworkInterface $resolvedInstance) {
162 $this->resolvedInstance = $resolvedInstance;