Ejemplo n.º 1
0
 public function executeGetStates()
 {
     $countryId = $this->getRequestParameter('country');
     $userId = sfContext::getInstance()->getUser()->getAttribute('subscriber_id', null, 'subscriber');
     $profile = UserProfilePeer::retrieveByPK($userId);
     if ($profile && $profile->getState()) {
         $this->currentState = $profile->getState();
     } else {
         $this->currentState = -1;
     }
     if ($countryId) {
         $this->states = CpStatesPeer::getAllStatesByCountry($countryId);
     } else {
         $this->states = null;
     }
 }