Exemplo n.º 1
0
 function setVitalSignValues(array $vitalSigns)
 {
     foreach ($vitalSigns as $vitalSignData) {
         $vitalSignValue = new VitalSignValue();
         $vitalSignValue->populateWithArray($vitalSignData);
         $this->vitalSignValues[] = $vitalSignValue;
     }
 }
 public function current()
 {
     $ormObj = new $this->_ormClass();
     //echo $this->_dbSelect->__toString();exit;
     //echo $this->_offset . "offset<br>\n";
     if (isset($this->_currentRow)) {
         $row = $this->_currentRow;
         $this->_currentRow = null;
         $this->_offset--;
     } else {
         $row = $this->_dbStmt->fetch(null, null, $this->_offset);
     }
     if (is_null($this->_currentGroupId)) {
         $this->_currentGroupId = $row['vitalSignGroupId'];
     }
     //echo "start: " . $this->_currentGroupId . "<br>";
     //echo "start: " . $row['vital'] . "<br>";
     $ormObj->populateWithArray($row);
     $values = array();
     $vitalSignValue = new VitalSignValue();
     $vitalSignValue->populateWithArray($row);
     $values[] = $vitalSignValue;
     while ($this->_offset + 1 < $this->_dbStmt->rowCount()) {
         $row = $this->_dbStmt->fetch(null, null, $this->_offset);
         $this->_offset++;
         $this->_currentRow = $row;
         if ($row['vitalSignGroupId'] === $this->_currentGroupId) {
             $vitalSignValue = new VitalSignValue();
             $vitalSignValue->populateWithArray($row);
             $values[] = $vitalSignValue;
         } else {
             break;
         }
     }
     $this->_currentGroupId = null;
     $ormObj->setVitalSignValues($values);
     //echo $ormObj->toString();
     return $ormObj;
 }