public function executeGetCities() { $stateId = $this->getRequestParameter('state'); $userId = sfContext::getInstance()->getUser()->getAttribute('subscriber_id', null, 'subscriber'); $profile = UserProfilePeer::retrieveByPK($userId); if ($profile && $profile->getCity()) { $this->currentCity = $profile->getCity(); } else { $this->currentCity = -1; } if ($stateId) { $this->cities = CpCitiesPeer::getAllCitiesByState($stateId); } else { $this->cities = null; } }