]> git.mxchange.org Git - city.git/blob - application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php
Next wave:
[city.git] / application / city / interfaces / database / frontend / city / class_CityInformationWrapper.php
1 <?php
2 // Own namespace
3 namespace Org\Mxchange\City\Database\Frontend\Information;
4
5 // Import own stuff
6 use Org\Mxchange\City\Daemon\BaseCityDaemon;
7 use Org\Mxchange\City\Helper\CityHelper;
8
9 // Import framework stuff
10 use Org\Mxchange\CoreFramework\Request\Requestable;
11
12 /**
13  * An interface for city-information (database) wrapper
14  *
15  * @author              Roland Haeder <webmaster@shipsimu.org>
16  * @version             0.0.0
17  * @copyright   Copyright (c) 2015, 2016 City Developer Team
18  * @license             GNU GPL 3.0 or any newer version
19  * @link                http://www.shipsimu.org
20  *
21  * This program is free software: you can redistribute it and/or modify
22  * it under the terms of the GNU General Public License as published by
23  * the Free Software Foundation, either version 3 of the License, or
24  * (at your option) any later version.
25  *
26  * This program is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29  * GNU General Public License for more details.
30  *
31  * You should have received a copy of the GNU General Public License
32  * along with this program. If not, see <http://www.gnu.org/licenses/>.
33  */
34 interface CityInformationWrapper extends DatabaseWrapper {
35         /**
36          * 'Registers' a new city id along with data provided in the city instance.
37          * This may sound confusing but avoids double code very nicely...
38          *
39          * @param       $cityInstance           A city instance
40          * @param       $requestInstance        An instance of a Requestable class
41          * @return      void
42          */
43         function registerCityId (BaseCityDaemon $cityInstance, Requestable $requestInstance);
44
45         /**
46          * Checks whether there is an entry for given city instance
47          *
48          * @param       $cityInstance   An instance of a CityHelper class
49          * @return      $isFound                Whether a city id has been found for this city
50          */
51         function ifCityDataIsFound (CityHelper $cityInstance);
52
53         /**
54          * Removes non-data from given array.
55          *
56          * @param       $data   An array with possible non-data that needs to be removed.
57          * @return      $data   A cleaned up array with only data.
58          */
59         function removeNonPublicDataFromArray(array $data);
60
61         /**
62          * Checks whether the user has already founded a city
63          *
64          * @return      $hasFounded             Whether the user has already founded a city
65          */
66         function ifUserHasFoundedCity ();
67
68         /**
69          * Checks whether the given city name is taken
70          *
71          * @para        $cityName       Name of city
72          * @return      $isTaken        Whether the given city name is taken
73          */
74         function ifCityExists ($cityName);
75
76         /**
77          * Creates a city from given request
78          *
79          * @para        $requestInstance        An instance of a Requestable class
80          * @return      void
81          */
82         function createCityByRequest (Requestable $requestInstance);
83
84         /**
85          * Getter for all city ids as an array
86          *
87          * @return      $cityIds        All city ids as an array
88          */
89         function getAllCityIds ();
90 }