// Get a new instance
$managerInstance = ManagerFactory::createManagerByType('city');
+ // Make sure the instance is valid
+ assert($managerInstance instanceof ManageableCity);
+
// Does the city name exist?
$alreadyTaken = ($managerInstance->ifCityNameExists($cityName));