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;
    }
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;
    }
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 ; }
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
Check if a track should be created for any of the filters