]> git.mxchange.org Git - city.git/blob - application/city/classes/database/frontend/game_options/class_CityGameOptionsDatabaseWrapper.php
Continued:
[city.git] / application / city / classes / database / frontend / game_options / class_CityGameOptionsDatabaseWrapper.php
1 <?php
2 // Own namespace
3 namespace Org\Mxchange\City\Database\Frontend\GameOptions;
4
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Database\Frontend\BaseDatabaseWrapper;
7 use Org\Mxchange\CoreFramework\Registry\Registerable;
8
9 /**
10  * A database wrapper for game options
11  *
12  * @author              Roland Haeder <webmaster@shipsimu.org>
13  * @version             0.0.0
14  * @copyright   Copyright (c) 2015, 2016 City Developer Team
15  * @license             GNU GPL 3.0 or any newer version
16  * @link                http://www.shipsimu.org
17  *
18  * This program is free software: you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation, either version 3 of the License, or
21  * (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program. If not, see <http://www.gnu.org/licenses/>.
30  */
31 class CityGameOptionsDatabaseWrapper extends BaseDatabaseWrapper implements CityGameOptionsWrapper, Registerable {
32         // Constants for database table names
33         const DB_TABLE_GAME_OPTION_INFORMATION = 'game_options';
34
35         // Constants for database column names
36         const DB_COLUMN_GAME_OPTION_ID          = 'game_id';
37         const DB_COLUMN_GAME_OPTION_USER_ID     = 'game_user_id';
38         const DB_COLUMN_GAME_OPTION_FLAG_PAUSED = 'game_flag_paused';
39
40         /**
41          * Protected constructor
42          *
43          * @return      void
44          */
45         protected function __construct () {
46                 // Call parent constructor
47                 parent::__construct(__CLASS__);
48         }
49
50         /**
51          * Creates an instance of this database wrapper by a provided user class
52          *
53          * @return      $wrapperInstance        An instance of the created wrapper class
54          */
55         public static final function createCityGameOptionsDatabaseWrapper () {
56                 // Get a new instance
57                 $wrapperInstance = new CityGameOptionsDatabaseWrapper();
58
59                 // Set (primary!) table name
60                 $wrapperInstance->setTableName(self::DB_TABLE_GAME_OPTION_INFORMATION);
61
62                 // Return the instance
63                 return $wrapperInstance;
64         }
65 }