public static function loadFromXML($xmlDaos) { $daos = array(); $doc = new DOMDocument('1.0', 'utf-8'); $doc->loadXML($xmlDaos); $nodes = $doc->getElementsByTagName("Impresion"); foreach ($nodes as $node) { $dao = new ImpresionDTO(); $data = $node->getElementsByTagName("Impresion_Id"); if ($data->length > 0) { $data = $data->item(0)->nodeValue; } else { $data = null; } $dao->setId($data); $data = $node->getElementsByTagName("impresionFecha"); if ($data->length > 0 && !ImpresionDTO::isEmpty($data->item(0)->nodeValue)) { $data = $data->item(0)->nodeValue; } else { $data = null; } $dao->setImpresionFecha($data); $data = $node->getElementsByTagName("impresionLugar"); if ($data->length > 0 && !ImpresionDTO::isEmpty($data->item(0)->nodeValue)) { $data = $data->item(0)->nodeValue; } else { $data = null; } $dao->setImpresionLugar($data); $data = $node->getElementsByTagName("impresionEstudiante"); if ($data->length > 0 && !empty($data->item(0)->nodeValue)) { $data = $data->item(0)->nodeValue; } else { $data = null; } $dao->setImpresionEstudiante($data); $daos[] = $dao; } return $daos; }
public function loadFromSqlResultQuery($rq) { $this->id = $rq[$this->PRIMARY_KEY_DB_NAME]; if (isset($rq[$this->IMPRESION_FECHA]) && !ImpresionDTO::isEmpty($rq[$this->IMPRESION_FECHA])) { $this->impresionFecha = $this->scapeString($rq[$this->IMPRESION_FECHA]); } else { $this->impresionFecha = null; } if (isset($rq[$this->IMPRESION_LUGAR]) && !ImpresionDTO::isEmpty($rq[$this->IMPRESION_LUGAR])) { $this->impresionLugar = $this->scapeString($rq[$this->IMPRESION_LUGAR]); } else { $this->impresionLugar = null; } if (isset($rq[$this->IMPRESION_ESTUDIANTE]) && !ImpresionDTO::isEmpty($rq[$this->IMPRESION_ESTUDIANTE])) { $this->impresionEstudiante = $this->scapeString($rq[$this->IMPRESION_ESTUDIANTE]); } else { $this->impresionEstudiante = null; } }