Beispiel #1
0
 /**
  * Process SDIF records from the Queue
  *
  * @return int number of records purged
  */
 function ProcessQueueC1Records()
 {
     //  Need C1 record to add or update the swim meet
     $this->setQuery(sprintf('SELECT sdifrecord FROM %s WHERE recordtype="C1"', FT_SDIFQUEUE_TABLE));
     $this->runSelectQuery(true);
     //$sdifrecord = new SDIFC1Record() ;
     $sdifrecord = new SwimTeam();
     $rslts = $this->getQueryResults();
     $rsltscnt = $this->getQueryCount();
     //  Process each C1 record in the file.
     foreach ($rslts as $rslt) {
         $sdifrecord->setSDIFRecord($rslt["sdifrecord"]);
         $sdifrecord->ParseRecord();
         if (!$sdifrecord->SwimTeamExistsByName()) {
             $sdifrecord->AddSwimTeam();
         } else {
             $this->add_status_message(sprintf('Swim Team "%s" already exists in the database, ignored.', $sdifrecord->getTeamName()), FT_WARNING);
         }
     }
     //return $this->getAffectedRows() ;
     return $rsltscnt;
 }