original_string: protected function checkCreateTracks($filters, $existingTracks, $tracker)
      {
          $tokenChanges = 0;
  
          // Check for tracks that should be created
          foreach ($filters as $filter) {
              if (!$filter->isCreator()) {
                  continue;
              }
  
              $createTrack = true;
  
              // Find the method to use for this creator type
              $method      = $this->getCreatorCheckMethod($filter->getCreatorType());
              $trackId     = $filter->getTrackId();
              $tracks      = array_key_exists($trackId, $existingTracks) ? $existingTracks[$trackId] : [];
  
              foreach($tracks as $respTrack) {
                  /* @var $respTrack \Gems_Tracker_RespondentTrack */
                  if (!$respTrack->hasSuccesCode()) { continue; }
  
                  $createTrack = $this->$method($filter, $respTrack);
                  if ($createTrack === false) {
                      break;  // Stop checking
                  }
              }
  
              // \MUtil_Echo::track($trackId, $createTrack, $filter->getName(), $filter->getSqlAppointmentsWhere(), $filter->getFilterId());
              if ($createTrack) {
                  $respTrack = $this->_createTrack($filter, $tracker);
                  $existingTracks[$trackId][] = $respTrack;
  
                  $tokenChanges += $respTrack->getCount();
              }
          }
  
          return $tokenChanges;
      }
code: protected function checkCreateTracks($filters, $existingTracks, $tracker)
      {
          $tokenChanges = 0;
  
          // Check for tracks that should be created
          foreach ($filters as $filter) {
              if (!$filter->isCreator()) {
                  continue;
              }
  
              $createTrack = true;
  
              // Find the method to use for this creator type
              $method      = $this->getCreatorCheckMethod($filter->getCreatorType());
              $trackId     = $filter->getTrackId();
              $tracks      = array_key_exists($trackId, $existingTracks) ? $existingTracks[$trackId] : [];
  
              foreach($tracks as $respTrack) {
                  /* @var $respTrack \Gems_Tracker_RespondentTrack */
                  if (!$respTrack->hasSuccesCode()) { continue; }
  
                  $createTrack = $this->$method($filter, $respTrack);
                  if ($createTrack === false) {
                      break;  // Stop checking
                  }
              }
  
              // \MUtil_Echo::track($trackId, $createTrack, $filter->getName(), $filter->getSqlAppointmentsWhere(), $filter->getFilterId());
              if ($createTrack) {
                  $respTrack = $this->_createTrack($filter, $tracker);
                  $existingTracks[$trackId][] = $respTrack;
  
                  $tokenChanges += $respTrack->getCount();
              }
          }
  
          return $tokenChanges;
      }
code_tokens: protected function checkCreateTracks ( $ filters , $ existingTracks , $ tracker ) { $ tokenChanges = 0 ; // Check for tracks that should be created foreach ( $ filters as $ filter ) { if ( ! $ filter -> isCreator ( ) ) { continue ; } $ createTrack = true ; // Find the method to use for this creator type $ method = $ this -> getCreatorCheckMethod ( $ filter -> getCreatorType ( ) ) ; $ trackId = $ filter -> getTrackId ( ) ; $ tracks = array_key_exists ( $ trackId , $ existingTracks ) ? $ existingTracks [ $ trackId ] : [ ] ; foreach ( $ tracks as $ respTrack ) { /* @var $respTrack \Gems_Tracker_RespondentTrack */ if ( ! $ respTrack -> hasSuccesCode ( ) ) { continue ; } $ createTrack = $ this -> $ method ( $ filter , $ respTrack ) ; if ( $ createTrack === false ) { break ; // Stop checking } } // \MUtil_Echo::track($trackId, $createTrack, $filter->getName(), $filter->getSqlAppointmentsWhere(), $filter->getFilterId()); if ( $ createTrack ) { $ respTrack = $ this -> _createTrack ( $ filter , $ tracker ) ; $ existingTracks [ $ trackId ] [ ] = $ respTrack ; $ tokenChanges += $ respTrack -> getCount ( ) ; } } return $ tokenChanges ; }
docstring: Check if a track should be created for any of the filters
  
  @param \Gems\Agenda\AppointmentFilterInterface[] $filters
  @param array $existingTracks
  @param \Gems_Tracker $tracker
  
  @return int Number of tokenchanges
docstring_tokens: Check if a track should be created for any of the filters