original_string: public function getFieldInput($field)
      {
          $model = ClassRegistry::init($this->usersModel);
  
          switch ($field) {
              case 'username':
                  $username = trim($this->in('Username:'));
  
                  if (!$username) {
                      $username = $this->getFieldInput($field);
  
                  } else {
                      $result = $model->find('count', array(
                          'conditions' => array($model->alias . '.' . $this->userFields['username'] => $username)
                      ));
  
                      if ($result) {
                          $this->out('<error>Username already exists, please try again</error>');
                          $username = $this->getFieldInput($field);
                      }
                  }
  
                  return $username;
                  break;
  
              case 'email':
                  $email = trim($this->in('Email:'));
  
                  if (!$email) {
                      $email = $this->getFieldInput($field);
  
                  } else if (!Validation::email($email)) {
                      $this->out('<error>Invalid email address, please try again</error>');
                      $email = $this->getFieldInput($field);
  
                  } else {
                      $result = $model->find('count', array(
                          'conditions' => array($model->alias . '.' . $this->userFields['email'] => $email)
                      ));
  
                      if ($result) {
                          $this->out('<error>Email already exists, please try again</error>');
                          $email = $this->getFieldInput($field);
                      }
                  }
  
                  return $email;
                  break;
  
              // Password, others...
              default:
                  $value = trim($this->in(sprintf('%s:', Inflector::humanize($field))));
  
                  if (!$value) {
                      $value = $this->getFieldInput($field);
                  }
  
                  return $value;
                  break;
          }
      }
code: public function getFieldInput($field)
      {
          $model = ClassRegistry::init($this->usersModel);
  
          switch ($field) {
              case 'username':
                  $username = trim($this->in('Username:'));
  
                  if (!$username) {
                      $username = $this->getFieldInput($field);
  
                  } else {
                      $result = $model->find('count', array(
                          'conditions' => array($model->alias . '.' . $this->userFields['username'] => $username)
                      ));
  
                      if ($result) {
                          $this->out('<error>Username already exists, please try again</error>');
                          $username = $this->getFieldInput($field);
                      }
                  }
  
                  return $username;
                  break;
  
              case 'email':
                  $email = trim($this->in('Email:'));
  
                  if (!$email) {
                      $email = $this->getFieldInput($field);
  
                  } else if (!Validation::email($email)) {
                      $this->out('<error>Invalid email address, please try again</error>');
                      $email = $this->getFieldInput($field);
  
                  } else {
                      $result = $model->find('count', array(
                          'conditions' => array($model->alias . '.' . $this->userFields['email'] => $email)
                      ));
  
                      if ($result) {
                          $this->out('<error>Email already exists, please try again</error>');
                          $email = $this->getFieldInput($field);
                      }
                  }
  
                  return $email;
                  break;
  
              // Password, others...
              default:
                  $value = trim($this->in(sprintf('%s:', Inflector::humanize($field))));
  
                  if (!$value) {
                      $value = $this->getFieldInput($field);
                  }
  
                  return $value;
                  break;
          }
      }
code_tokens: public function getFieldInput ( $ field ) { $ model = ClassRegistry :: init ( $ this -> usersModel ) ; switch ( $ field ) { case 'username' : $ username = trim ( $ this -> in ( 'Username:' ) ) ; if ( ! $ username ) { $ username = $ this -> getFieldInput ( $ field ) ; } else { $ result = $ model -> find ( 'count' , array ( 'conditions' => array ( $ model -> alias . '.' . $ this -> userFields [ 'username' ] => $ username ) ) ) ; if ( $ result ) { $ this -> out ( '<error>Username already exists, please try again</error>' ) ; $ username = $ this -> getFieldInput ( $ field ) ; } } return $ username ; break ; case 'email' : $ email = trim ( $ this -> in ( 'Email:' ) ) ; if ( ! $ email ) { $ email = $ this -> getFieldInput ( $ field ) ; } else if ( ! Validation :: email ( $ email ) ) { $ this -> out ( '<error>Invalid email address, please try again</error>' ) ; $ email = $ this -> getFieldInput ( $ field ) ; } else { $ result = $ model -> find ( 'count' , array ( 'conditions' => array ( $ model -> alias . '.' . $ this -> userFields [ 'email' ] => $ email ) ) ) ; if ( $ result ) { $ this -> out ( '<error>Email already exists, please try again</error>' ) ; $ email = $ this -> getFieldInput ( $ field ) ; } } return $ email ; break ; // Password, others...
   default : $ value = trim ( $ this -> in ( sprintf ( '%s:' , Inflector :: humanize ( $ field ) ) ) ) ; if ( ! $ value ) { $ value = $ this -> getFieldInput ( $ field ) ; } return $ value ; break ; } }
docstring: Get the value of an input.
  
  @param string $field
  @return string
docstring_tokens: Get the value of an input .