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