Example #1
0
 public function toDTO()
 {
     $salonDTO = new SalonDTO();
     $salonDTO->setId($this->getId());
     $salonDTO->setSalonNombre($this->unscapeString($this->getSalonNombre()));
     return $salonDTO;
 }
Example #2
0
 public static function loadFromXML($xmlDaos)
 {
     $daos = array();
     $doc = new DOMDocument('1.0', 'utf-8');
     $doc->loadXML($xmlDaos);
     $nodes = $doc->getElementsByTagName("Salon");
     foreach ($nodes as $node) {
         $dao = new SalonDTO();
         $data = $node->getElementsByTagName("Salon_Id");
         if ($data->length > 0) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setId($data);
         $data = $node->getElementsByTagName("salonNombre");
         if ($data->length > 0 && !SalonDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setSalonNombre($data);
         $daos[] = $dao;
     }
     return $daos;
 }