public static function loadFromXML($xmlDaos)
 {
     $daos = array();
     $doc = new DOMDocument('1.0', 'utf-8');
     $doc->loadXML($xmlDaos);
     $nodes = $doc->getElementsByTagName("MonitorSalon");
     foreach ($nodes as $node) {
         $dao = new MonitorSalonDTO();
         $data = $node->getElementsByTagName("MonitorSalon_Id");
         if ($data->length > 0) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setId($data);
         $data = $node->getElementsByTagName("monitorSalonEntrada");
         if ($data->length > 0 && !MonitorSalonDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setMonitorSalonEntrada($data);
         $data = $node->getElementsByTagName("monitorSalonSalida");
         if ($data->length > 0 && !MonitorSalonDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setMonitorSalonSalida($data);
         $data = $node->getElementsByTagName("monitorSalonComentarios");
         if ($data->length > 0 && !MonitorSalonDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setMonitorSalonComentarios($data);
         $data = $node->getElementsByTagName("monitor");
         if ($data->length > 0 && !empty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setMonitor($data);
         $data = $node->getElementsByTagName("salon");
         if ($data->length > 0 && !empty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setSalon($data);
         $daos[] = $dao;
     }
     return $daos;
 }
 /**
  * Listar algunos MonitorSalon dado el $salonId
  * 
  * @param $salonId
  * @param $performSize
  * @param $firstResultNumber
  * @param $numResults
  */
 public function listMonitorSalonsBySalonId($salonId, $performSize = false, $firstResultNumber = null, $numResults = null, $orderBy = null, $orderPriority = SQL_ASCENDING_ORDER)
 {
     $objBean = new SalonBean($this->persistenceManager);
     $obj = new Salon();
     $obj->setId($salonId);
     # Validamos los campos
     if ($firstResultNumber !== null && !EntityValidator::validatePositiveNumber($firstResultNumber)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 111);
     }
     if (!EntityValidator::validateGlobalOrderPriority($orderPriority)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 113);
     }
     if (!EntityValidator::validateId($salonId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 115);
     }
     # Verificamos que la entidad exista
     if (!$objBean->getSalon($obj)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 117);
     }
     # Listamos las entidades
     if ($performSize) {
         $this->lastRequestSize = $this->monitorSalonBean->countGetMonitorSalonsBySalon($obj);
     }
     return MonitorSalonDTO::loadFromEntities($this->monitorSalonBean->listMonitorSalonsBySalon($obj, $firstResultNumber, $numResults, $orderBy, $orderPriority));
 }
 public function toDTO()
 {
     $monitorSalonDTO = new MonitorSalonDTO();
     $monitorSalonDTO->setId($this->getId());
     $monitorSalonDTO->setMonitorSalonEntrada($this->unscapeString($this->getMonitorSalonEntrada()));
     $monitorSalonDTO->setMonitorSalonSalida($this->unscapeString($this->getMonitorSalonSalida()));
     $monitorSalonDTO->setMonitorSalonComentarios($this->unscapeString($this->getMonitorSalonComentarios()));
     $monitorSalonDTO->setMonitor($this->unscapeString($this->getMonitor()));
     $monitorSalonDTO->setSalon($this->unscapeString($this->getSalon()));
     return $monitorSalonDTO;
 }
 public function updateMonitorSalon($monitorSalonDTO)
 {
     try {
         $ctrl = new MonitorSalonController($this->persistenceManager);
         $monitorSalon = new MonitorSalonDTO();
         $monitorSalon->setId($monitorSalonDTO->getId());
         $ctrl->getMonitorSalon($monitorSalon);
         $monitorSalon->setMonitorSalonEntrada($monitorSalonDTO->getMonitorSalonEntrada());
         $monitorSalon->setMonitorSalonSalida($monitorSalonDTO->getMonitorSalonSalida());
         $monitorSalon->setMonitorSalonComentarios($monitorSalonDTO->getMonitorSalonComentarios());
         $ctrl->updateMonitorSalon($monitorSalon);
         $cm = new CommunicationMensaje(true, SALAS_COMP_ALERT_A_OPERATION_SUCCESS, $this->ID + 97, $monitorSalon);
         return $cm;
     } catch (Exception $e) {
         return new CommunicationMensaje(false, $e->getMessage(), $this->ID + 98 . "->" . $e->getCode());
     }
 }