public function loadFromSqlResultQuery($rq) { $this->id = $rq[$this->PRIMARY_KEY_DB_NAME]; if (isset($rq[$this->MONITOR_TIPO]) && !MonitorDTO::isEmpty($rq[$this->MONITOR_TIPO])) { $this->monitorTipo = $this->scapeString($rq[$this->MONITOR_TIPO]); } else { $this->monitorTipo = null; } if (isset($rq[$this->MONITOR_HORARIO]) && !MonitorDTO::isEmpty($rq[$this->MONITOR_HORARIO])) { $this->monitorHorario = $this->scapeString($rq[$this->MONITOR_HORARIO]); } else { $this->monitorHorario = null; } if (isset($rq[$this->MONITOR_ESTUDIANTE]) && !MonitorDTO::isEmpty($rq[$this->MONITOR_ESTUDIANTE])) { $this->monitorEstudiante = $this->scapeString($rq[$this->MONITOR_ESTUDIANTE]); } else { $this->monitorEstudiante = null; } }
public static function loadFromXML($xmlDaos) { $daos = array(); $doc = new DOMDocument('1.0', 'utf-8'); $doc->loadXML($xmlDaos); $nodes = $doc->getElementsByTagName("Monitor"); foreach ($nodes as $node) { $dao = new MonitorDTO(); $data = $node->getElementsByTagName("Monitor_Id"); if ($data->length > 0) { $data = $data->item(0)->nodeValue; } else { $data = null; } $dao->setId($data); $data = $node->getElementsByTagName("monitorTipo"); if ($data->length > 0 && !MonitorDTO::isEmpty($data->item(0)->nodeValue)) { $data = $data->item(0)->nodeValue; } else { $data = null; } $dao->setMonitorTipo($data); $data = $node->getElementsByTagName("monitorHorario"); if ($data->length > 0 && !MonitorDTO::isEmpty($data->item(0)->nodeValue)) { $data = $data->item(0)->nodeValue; } else { $data = null; } $dao->setMonitorHorario($data); $data = $node->getElementsByTagName("monitorEstudiante"); if ($data->length > 0 && !empty($data->item(0)->nodeValue)) { $data = $data->item(0)->nodeValue; } else { $data = null; } $dao->setMonitorEstudiante($data); $daos[] = $dao; } return $daos; }