示例#1
0
 function processHoldQueue($id)
 {
     //Check to see if there are any copies available for the next person
     $holdings = $this->getHolding($id);
     $holdingSummary = $this->getStatusSummary($id, $holdings);
     if ($holdingSummary['availableCopies'] >= 1) {
         $eContentHold = new EContentHold();
         $eContentHold->recordId = $id;
         $eContentHold->status = 'active';
         $eContentHold->orderBy('datePlaced ASC');
         $eContentHold->limit(0, 1);
         if ($eContentHold->find(true)) {
             //The next user in the list should get the hold
             $eContentHold->status = 'available';
             $eContentHold->dateUpdated = time();
             $eContentHold->update();
         }
     }
 }