]> git.mxchange.org Git - city.git/blob - application/city/interfaces/database/frontend/city/class_CityInformationWrapper.php
370dc043444339127bc15d875656640763bf3d0f
[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
8 // Import framework stuff
9 use Org\Mxchange\CoreFramework\Request\Requestable;
10
11 /**
12  * An interface for city-information (database) wrapper
13  *
14  * @author              Roland Haeder <webmaster@shipsimu.org>
15  * @version             0.0.0
16  * @copyright   Copyright (c) 2015, 2016 City Developer Team
17  * @license             GNU GPL 3.0 or any newer version
18  * @link                http://www.shipsimu.org
19  *
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.
24  *
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.
29  *
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/>.
32  */
33 interface CityInformationWrapper extends DatabaseWrapper {
34         /**
35          * 'Registers' a new city id along with data provided in the city instance.
36          * This may sound confusing but avoids double code very nicely...
37          *
38          * @param       $cityInstance           A city instance
39          * @param       $requestInstance        An instance of a Requestable class
40          * @return      void
41          */
42         function registerCityId (BaseCityDaemon $cityInstance, Requestable $requestInstance);
43
44         /**
45          * Checks whether there is an entry for given city instance
46          *
47          * @param       $cityInstance   An instance of a CityHelper class
48          * @return      $isFound                Whether a city id has been found for this city
49          */
50         function ifCityDataIsFound (CityHelper $cityInstance);
51
52         /**
53          * Removes non-data from given array.
54          *
55          * @param       $data   An array with possible non-data that needs to be removed.
56          * @return      $data   A cleaned up array with only data.
57          */
58         function removeNonPublicDataFromArray(array $data);
59
60         /**
61          * Checks whether the user has already founded a city
62          *
63          * @return      $hasFounded             Whether the user has already founded a city
64          */
65         function ifUserHasFoundedCity ();
66
67         /**
68          * Checks whether the given city name is taken
69          *
70          * @para        $cityName       Name of city
71          * @return      $isTaken        Whether the given city name is taken
72          */
73         function ifCityExists ($cityName);
74
75         /**
76          * Creates a city from given request
77          *
78          * @para        $requestInstance        An instance of a Requestable class
79          * @return      void
80          */
81         function createCityByRequest (Requestable $requestInstance);
82
83         /**
84          * Getter for all city ids as an array
85          *
86          * @return      $cityIds        All city ids as an array
87          */
88         function getAllCityIds ();
89 }