public static function create_status()
 {
     // If the script is to be started create a new status
     $status = self::create();
     $status->updateJobInfo('Creating new tracking object');
     // Setup all pages to test
     $pageIDs = Versioned::get_by_stage('SiteTree', 'Stage')->column('ID');
     foreach ($pageIDs as $pageID) {
         $trackPage = BrokenExternalPageTrack::create();
         $trackPage->PageID = $pageID;
         $trackPage->StatusID = $status->ID;
         $trackPage->write();
     }
     return $status;
 }
 private function updateCompletedPages($trackID = 0)
 {
     $noPages = BrokenExternalPageTrack::get()->filter(array('TrackID' => $trackID, 'Processed' => 1))->count();
     $track = BrokenExternalPageTrackStatus::get_latest();
     $track->CompletedPages = $noPages;
     $track->write();
     return $noPages;
 }