Exemple #1
0
 public function toDTO()
 {
     $tareaDTO = new TareaDTO();
     $tareaDTO->setId($this->getId());
     $tareaDTO->setTareaDescripcion($this->unscapeString($this->getTareaDescripcion()));
     $tareaDTO->setTareaComentarios($this->unscapeString($this->getTareaComentarios()));
     $tareaDTO->setTareaFechaInicio($this->unscapeString($this->getTareaFechaInicio()));
     $tareaDTO->setTareaFechaFin($this->unscapeString($this->getTareaFechaFin()));
     $tareaDTO->setTareaMonitor($this->unscapeString($this->getTareaMonitor()));
     return $tareaDTO;
 }
 public static function loadFromXML($xmlDaos)
 {
     $daos = array();
     $doc = new DOMDocument('1.0', 'utf-8');
     $doc->loadXML($xmlDaos);
     $nodes = $doc->getElementsByTagName("Tarea");
     foreach ($nodes as $node) {
         $dao = new TareaDTO();
         $data = $node->getElementsByTagName("Tarea_Id");
         if ($data->length > 0) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setId($data);
         $data = $node->getElementsByTagName("tareaDescripcion");
         if ($data->length > 0 && !TareaDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setTareaDescripcion($data);
         $data = $node->getElementsByTagName("tareaComentarios");
         if ($data->length > 0 && !TareaDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setTareaComentarios($data);
         $data = $node->getElementsByTagName("tareaFechaInicio");
         if ($data->length > 0 && !TareaDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setTareaFechaInicio($data);
         $data = $node->getElementsByTagName("tareaFechaFin");
         if ($data->length > 0 && !TareaDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setTareaFechaFin($data);
         $data = $node->getElementsByTagName("tareaMonitor");
         if ($data->length > 0 && !empty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setTareaMonitor($data);
         $daos[] = $dao;
     }
     return $daos;
 }