示例#1
0
 /**
  * Get the next Contract found.
  * @return Contract|null
  */
 function getContract()
 {
     $this->execQuery();
     if ($this->offset && $this->contractcounter < $this->offset) {
         for ($i = 0; $i < $this->offset; $i++) {
             $row = $this->qry->getRow();
             $this->contractcounter++;
         }
     }
     if ($this->limit && $this->contractcounter - $this->offset > $this->limit) {
         return null;
     }
     $row = $this->qry->getRow();
     if ($row) {
         $this->contractcounter++;
         return new Contract($row['ctr_id']);
     } else {
         return null;
     }
 }
示例#2
0
 /**
  * Iterate through the list of items returned, returning one for each call
  *
  * @return Item
  */
 function getItem()
 {
     if (!$this->executed) {
         $this->execute();
     }
     if ($row = $this->qry->getRow()) {
         // Set up a new Item and return it.
         $item = new Item($row['typeID'], $row);
         return $item;
     }
     return null;
 }