original_string: public function checkTokensFrom(\Gems_Tracker_RespondentTrack $respTrack, \Gems_Tracker_Token $startToken, $userId, \Gems_Tracker_Token $skipToken = null)
      {
          // Make sure the rounds are loaded
          $this->_ensureRounds();
  
          // Make sure the tokens are loaded and linked.
          $respTrack->getTokens();
  
          // Go
          $changed = 0;
          $token = $startToken;
          while ($token) {
              // \MUtil_Echo::track($token->getTokenId());
              //Only process the token when linked to a round
              $round   = false;
              $changes = 0;
              if (array_key_exists($token->getRoundId(), $this->_rounds)) {
                  $round = $this->_rounds[$token->getRoundId()];
              }            
  
              if ($round && $token !== $skipToken) {
                  $changes = $this->checkTokenDates($token, $round, $userId);
                  $changes += $this->checkTokenCondition($token, $round, $userId);
              }            
  
              // If condition changed and dates changed, we only signal one change
              $changed += min($changes, 1);
              $token = $token->getNextToken();
          }
  
          return $changed;
      }
code: public function checkTokensFrom(\Gems_Tracker_RespondentTrack $respTrack, \Gems_Tracker_Token $startToken, $userId, \Gems_Tracker_Token $skipToken = null)
      {
          // Make sure the rounds are loaded
          $this->_ensureRounds();
  
          // Make sure the tokens are loaded and linked.
          $respTrack->getTokens();
  
          // Go
          $changed = 0;
          $token = $startToken;
          while ($token) {
              // \MUtil_Echo::track($token->getTokenId());
              //Only process the token when linked to a round
              $round   = false;
              $changes = 0;
              if (array_key_exists($token->getRoundId(), $this->_rounds)) {
                  $round = $this->_rounds[$token->getRoundId()];
              }            
  
              if ($round && $token !== $skipToken) {
                  $changes = $this->checkTokenDates($token, $round, $userId);
                  $changes += $this->checkTokenCondition($token, $round, $userId);
              }            
  
              // If condition changed and dates changed, we only signal one change
              $changed += min($changes, 1);
              $token = $token->getNextToken();
          }
  
          return $changed;
      }
code_tokens: public function checkTokensFrom ( \ Gems_Tracker_RespondentTrack $ respTrack , \ Gems_Tracker_Token $ startToken , $ userId , \ Gems_Tracker_Token $ skipToken = null ) { // Make sure the rounds are loaded $ this -> _ensureRounds ( ) ; // Make sure the tokens are loaded and linked. $ respTrack -> getTokens ( ) ; // Go $ changed = 0 ; $ token = $ startToken ; while ( $ token ) { // \MUtil_Echo::track($token->getTokenId()); //Only process the token when linked to a round $ round = false ; $ changes = 0 ; if ( array_key_exists ( $ token -> getRoundId ( ) , $ this -> _rounds ) ) { $ round = $ this -> _rounds [ $ token -> getRoundId ( ) ] ; } if ( $ round && $ token !== $ skipToken ) { $ changes = $ this -> checkTokenDates ( $ token , $ round , $ userId ) ; $ changes += $ this -> checkTokenCondition ( $ token , $ round , $ userId ) ; } // If condition changed and dates changed, we only signal one change $ changed += min ( $ changes , 1 ) ; $ token = $ token -> getNextToken ( ) ; } return $ changed ; }
docstring: Check the valid from and until dates in the track starting at a specified token
  
  @param \Gems_Tracker_RespondentTrack $respTrack The respondent track to check
  @param \Gems_Tracker_Token $startToken The token to start at
  @param int $userId Id of the user who takes the action (for logging)
  @param \Gems_Tracker_Token $skipToken Optional token to skip in the recalculation
  @return int The number of tokens changed by this code
docstring_tokens: Check the valid from and until dates in the track starting at a specified token