예제 #1
0
 /**
  * Recupera a relação de Municipios
  * @param  integer $sqEstado
  * @return array
  * @throws BusinessException
  */
 public function listByUf($sqEstado)
 {
     try {
         $voMunicipio = MunicipioValueObject::factory()->setSqEstado((int) $sqEstado);
         $result = $this->getModelPersist('libcorp')->findByParam($voMunicipio)->getAllDataViewObject();
         return $this->arrayObjectToCombo('noMunicipio', 'sqMunicipio', $result);
     } catch (ModelException $mExcp) {
         throw new BusinessException($mExcp->getMessage());
     }
 }
function libCorpBiomaByMunicipio($sqMunicipio)
{
    try {
        $voMunicipio = MunicipioValueObject::factory()->setSqMunicipio($sqMunicipio);
        $tmpTxt = '<result>';
        $tmpResult = BiomaBusiness::factory()->findByMunicipio($voMunicipio);
        foreach ($tmpResult as $result) {
            $tmpTxt .= $result->toXml();
        }
        $tmpTxt .= '</result>';
        return $tmpTxt;
    } catch (\Exception $excp) {
        die(__FILE__ . "-" . __LINE__);
        throw new IOException($excp->getMessage());
    }
}
function libCorpUnidadeOrgByUndDescenCidade($noMunicipio)
{
    try {
        $voMunicipio = MunicipioValueObject::factory()->setNoMunicipio($noMunicipio);
        $unidadeOrgBusiness = UnidadeOrgBusiness::factory(NULL, 'libcorp');
        $tmpTxt = '<result>';
        $tmpResult = $unidadeOrgBusiness->findUndDescentralizadaByCidade($voMunicipio);
        foreach ($tmpResult as $result) {
            $tmpTxt .= $result->toXml();
        }
        $tmpTxt .= '</result>';
        return $tmpTxt;
    } catch (\Exception $excp) {
        throw new IOException($excp->getMessage());
    }
}