original_string: public function getTokenInfo(\Gems_Tracker_Token $token, $surveyId, $sourceSurveyId, array $fields = null)
      {
          if (! $token->cacheHas(self::CACHE_TOKEN_INFO)) {
              if (null === $sourceSurveyId) {
                  $sourceSurveyId = $this->_getSid($surveyId);
              }
  
              $lsTokens = $this->_getTokenTableName($sourceSurveyId);
              $tokenId  = $this->_getToken($token->getTokenId());
  
              $sql = 'SELECT *
                  FROM ' . $lsTokens . '
                  WHERE token = ? LIMIT 1';
  
              try {
                  $result = $this->getSourceDatabase()->fetchRow($sql, $tokenId);
              } catch (\Zend_Db_Statement_Exception $exception) {
                  $this->logger->logError($exception, $this->request);
                  $result = false;
              }
  
              $token->cacheSet(self::CACHE_TOKEN_INFO, $result);
          } else {
              $result = $token->cacheGet(self::CACHE_TOKEN_INFO);
          }
  
          if ($fields !== null) $result = array_intersect_key((array) $result, array_flip($fields));
  
          return $result;
      }
code: public function getTokenInfo(\Gems_Tracker_Token $token, $surveyId, $sourceSurveyId, array $fields = null)
      {
          if (! $token->cacheHas(self::CACHE_TOKEN_INFO)) {
              if (null === $sourceSurveyId) {
                  $sourceSurveyId = $this->_getSid($surveyId);
              }
  
              $lsTokens = $this->_getTokenTableName($sourceSurveyId);
              $tokenId  = $this->_getToken($token->getTokenId());
  
              $sql = 'SELECT *
                  FROM ' . $lsTokens . '
                  WHERE token = ? LIMIT 1';
  
              try {
                  $result = $this->getSourceDatabase()->fetchRow($sql, $tokenId);
              } catch (\Zend_Db_Statement_Exception $exception) {
                  $this->logger->logError($exception, $this->request);
                  $result = false;
              }
  
              $token->cacheSet(self::CACHE_TOKEN_INFO, $result);
          } else {
              $result = $token->cacheGet(self::CACHE_TOKEN_INFO);
          }
  
          if ($fields !== null) $result = array_intersect_key((array) $result, array_flip($fields));
  
          return $result;
      }
code_tokens: public function getTokenInfo ( \ Gems_Tracker_Token $ token , $ surveyId , $ sourceSurveyId , array $ fields = null ) { if ( ! $ token -> cacheHas ( self :: CACHE_TOKEN_INFO ) ) { if ( null === $ sourceSurveyId ) { $ sourceSurveyId = $ this -> _getSid ( $ surveyId ) ; } $ lsTokens = $ this -> _getTokenTableName ( $ sourceSurveyId ) ; $ tokenId = $ this -> _getToken ( $ token -> getTokenId ( ) ) ; $ sql = 'SELECT *
                  FROM ' . $ lsTokens . '
                  WHERE token = ? LIMIT 1' ; try { $ result = $ this -> getSourceDatabase ( ) -> fetchRow ( $ sql , $ tokenId ) ; } catch ( \ Zend_Db_Statement_Exception $ exception ) { $ this -> logger -> logError ( $ exception , $ this -> request ) ; $ result = false ; } $ token -> cacheSet ( self :: CACHE_TOKEN_INFO , $ result ) ; } else { $ result = $ token -> cacheGet ( self :: CACHE_TOKEN_INFO ) ; } if ( $ fields !== null ) $ result = array_intersect_key ( ( array ) $ result , array_flip ( $ fields ) ) ; return $ result ; }
docstring: Retrieve all fields stored in the token table, and store them in the tokencache
  
  @param \Gems_Tracker_Token $token
  @param type $surveyId
  @param type $sourceSurveyId
  @param array $fields
  @return type
docstring_tokens: Retrieve all fields stored in the token table and store them in the tokencache