Some updates:
[core.git] / framework / main / classes / handler / class_BaseHandler.php
1 <?php
2 // Own namespace
3 namespace Org\Mxchange\CoreFramework\Handler;
4
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
7 use Org\Mxchange\CoreFramework\Handler\DataSet\HandleableDataSet;
8 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
9
10 /**
11  * A general Handler
12  *
13  * @author              Roland Haeder <webmaster@shipsimu.org>
14  * @version             0.0.0
15 <<<<<<< HEAD:framework/main/classes/handler/class_BaseHandler.php
16  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
17 =======
18  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
19 >>>>>>> Some updates::inc/main/classes/handler/class_BaseHandler.php
20  * @license             GNU GPL 3.0 or any newer version
21  * @link                http://www.shipsimu.org
22  *
23  * This program is free software: you can redistribute it and/or modify
24  * it under the terms of the GNU General Public License as published by
25  * the Free Software Foundation, either version 3 of the License, or
26  * (at your option) any later version.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU General Public License
34  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
35  */
36 abstract class BaseHandler extends BaseFrameworkSystem implements HandleableDataSet {
37         /**
38          * Handler name
39          */
40         private $handlerName = 'invalid';
41
42         /**
43          * Protected constructor
44          *
45          * @param       $className      Name of the class
46          * @return      void
47          */
48         protected function __construct ($className) {
49                 // Call parent constructor
50                 parent::__construct($className);
51         }
52
53         /**
54          * Getter for handler name
55          *
56          * @return      $handlerName    Name of this handler
57          */
58         public final function getHandlerName () {
59                 return $this->handlerName;
60         }
61
62         /**
63          * Setter for handler name
64          *
65          * @param       $handlerName    Name of this handler
66          * @return      void
67          */
68         protected final function setHandlerName ($handlerName) {
69                 $this->handlerName = $handlerName;
70         }
71
72         /**
73          * Adds all required elements from given array into data set instance
74          *
75          * @param       $dataSetInstance        An instance of a StoreableCriteria class
76          * @param       $messageData            An array with all message data
77          * @return      void
78          * @todo        Rewrite this to use DHT
79          */
80         public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) {
81                 // Add some generic data all messageData arrays provide
82                 /*
83                 $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $messageData[BaseXmlAnswerTemplateEngine::ANSWER_STATUS]);
84                 $dataSetInstance->addCriteria(NodeListDatabaseWrapper::DB_COLUMN_MESSAGE_TYPE , $messageData[NetworkPackage::MESSAGE_ARRAY_TYPE]);
85                 */
86         }
87
88 }