]> git.mxchange.org Git - city.git/blobdiff - application/city/main/manager/city/class_CityManager.php
Added verifications, if the user has already founded a city and if the city name
[city.git] / application / city / main / manager / city / class_CityManager.php
index cc6924ca432de0e1c4a4192402a1fd0a1642f5ed..97abac722ca4f8cd90a31f11ac2dda7290daada3 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CityManager extends BaseFrameworkSystem implements ManageableCity {
+class CityManager extends BaseManager implements ManageableCity {
        /**
         * Protected constructor
         *
@@ -57,12 +57,26 @@ class CityManager extends BaseFrameworkSystem implements ManageableCity {
         * @return      $isFounded      Whether the current user has already founded a city
         */
        public function isCityAlreadyFounded () {
-               // Default is not found
-               $isFounded = FALSE;
+               // Check if the currently set user has already founded a city
+               $isFounded = $this->getWrapperInstance()->ifUserHasFoundedCity();
 
                // Return result
                return $isFounded;
        }
+
+       /**
+        * Checks whether the given city name is already taken
+        *
+        * @para        $cityName       Name of city
+        * @return      $isTaken        Whether the given city name is already taken
+        */
+       public function ifCityNameExists ($cityName) {
+               // Check if the given city name is taken
+               $isTaken = $this->getWrapperInstance()->ifCityExists($cityName);
+
+               // Return result
+               return $isTaken;
+       }
 }
 
 // [EOF]