/**
  * Listar algunos ComputadoraSoftware dado el $softwareId
  * 
  * @param $softwareId
  * @param $performSize
  * @param $firstResultNumber
  * @param $numResults
  */
 public function listComputadoraSoftwaresBySoftwareId($softwareId, $performSize = false, $firstResultNumber = null, $numResults = null, $orderBy = null, $orderPriority = SQL_ASCENDING_ORDER)
 {
     $objBean = new SoftwareBean($this->persistenceManager);
     $obj = new Software();
     $obj->setId($softwareId);
     # Validamos los campos
     if ($firstResultNumber !== null && !EntityValidator::validatePositiveNumber($firstResultNumber)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 105);
     }
     if (!EntityValidator::validateGlobalOrderPriority($orderPriority)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 107);
     }
     if (!EntityValidator::validateId($softwareId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 109);
     }
     # Verificamos que la entidad exista
     if (!$objBean->getSoftware($obj)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 111);
     }
     # Listamos las entidades
     if ($performSize) {
         $this->lastRequestSize = $this->computadoraSoftwareBean->countGetComputadoraSoftwaresBySoftware($obj);
     }
     return ComputadoraSoftwareDTO::loadFromEntities($this->computadoraSoftwareBean->listComputadoraSoftwaresBySoftware($obj, $firstResultNumber, $numResults, $orderBy, $orderPriority));
 }
 public static function loadFromXML($xmlDaos)
 {
     $daos = array();
     $doc = new DOMDocument('1.0', 'utf-8');
     $doc->loadXML($xmlDaos);
     $nodes = $doc->getElementsByTagName("ComputadoraSoftware");
     foreach ($nodes as $node) {
         $dao = new ComputadoraSoftwareDTO();
         $data = $node->getElementsByTagName("ComputadoraSoftware_Id");
         if ($data->length > 0) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setId($data);
         $data = $node->getElementsByTagName("numeroSeriePrograma");
         if ($data->length > 0 && !ComputadoraSoftwareDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setNumeroSeriePrograma($data);
         $data = $node->getElementsByTagName("compSoftFechaInstalacion");
         if ($data->length > 0 && !ComputadoraSoftwareDTO::isEmpty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setCompSoftFechaInstalacion($data);
         $data = $node->getElementsByTagName("computadora");
         if ($data->length > 0 && !empty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setComputadora($data);
         $data = $node->getElementsByTagName("software");
         if ($data->length > 0 && !empty($data->item(0)->nodeValue)) {
             $data = $data->item(0)->nodeValue;
         } else {
             $data = null;
         }
         $dao->setSoftware($data);
         $daos[] = $dao;
     }
     return $daos;
 }
 public function toDTO()
 {
     $computadoraSoftwareDTO = new ComputadoraSoftwareDTO();
     $computadoraSoftwareDTO->setId($this->getId());
     $computadoraSoftwareDTO->setNumeroSeriePrograma($this->unscapeString($this->getNumeroSeriePrograma()));
     $computadoraSoftwareDTO->setCompSoftFechaInstalacion($this->unscapeString($this->getCompSoftFechaInstalacion()));
     $computadoraSoftwareDTO->setComputadora($this->unscapeString($this->getComputadora()));
     $computadoraSoftwareDTO->setSoftware($this->unscapeString($this->getSoftware()));
     return $computadoraSoftwareDTO;
 }