Esempio n. 1
0
 public function toDTO()
 {
     $salonDTO = new SalonDTO();
     $salonDTO->setId($this->getId());
     $salonDTO->setSalonNombre($this->unscapeString($this->getSalonNombre()));
     return $salonDTO;
 }
Esempio n. 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;
 }
 public function updateSalon($salonDTO)
 {
     try {
         $ctrl = new SalonController($this->persistenceManager);
         $salon = new SalonDTO();
         $salon->setId($salonDTO->getId());
         $ctrl->getSalon($salon);
         $salon->setSalonNombre($salonDTO->getSalonNombre());
         $ctrl->updateSalon($salon);
         $cm = new CommunicationMensaje(true, SALAS_COMP_ALERT_A_OPERATION_SUCCESS, $this->ID + 7, $salon);
         return $cm;
     } catch (Exception $e) {
         return new CommunicationMensaje(false, $e->getMessage(), $this->ID + 8 . "->" . $e->getCode());
     }
 }
 /**
  * Listar algunos Salon que contenga $salonNombre
  * 
  * @param $salonNombre
  * @param $performSize
  * @param $firstResultNumber
  * @param $numResults
  */
 public function listSalonsBySalonNombreContains($salonNombre, $performSize = false, $firstResultNumber = null, $numResults = null, $orderBy = null, $orderPriority = SQL_ASCENDING_ORDER)
 {
     # Validamos los campos
     if ($firstResultNumber !== null && !EntityValidator::validatePositiveNumber($firstResultNumber)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 45);
     }
     if (!EntityValidator::validateGlobalOrderPriority($orderPriority)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 47);
     }
     if (!EntityValidator::validateString($salonNombre)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 49);
     }
     # Listamos las entidades
     if ($performSize) {
         $this->lastRequestSize = $this->salonBean->countGetSalonsBySalonNombreContains($salonNombre);
     }
     return SalonDTO::loadFromEntities($this->salonBean->listSalonsBySalonNombreContains($salonNombre, $firstResultNumber, $numResults, $orderBy, $orderPriority));
 }