function libCorpUnidadeOrgAtivaById($sqPessoa) { try { $voUnidade = UnidadeOrgValueObject::factory()->setSqPessoa($sqPessoa); $result = UnidadeOrgBusiness::factory(NULL, 'libcorp')->findUnidadeOrgAtivaById($voUnidade); $result = current($result); $result = !empty($result) ? $result->toXml() : NULL; return sprintf('<%1$s>%2$s</%1$s>', 'result', $result); } catch (\Exception $excp) { throw new IOException($excp->getMessage()); } }
public function findUnidadeOrgAtivaById(UnidadeOrgValueObject $voUnidOrg) { try { $voUnidOrg->setStAtivo(TRUE); return $this->getModelPersist('libcorp')->findByParam($voUnidOrg)->getAllDataViewObject(); } catch (ModelException $exp) { throw new BusinessException(Messages::ERROR, $exp->getCode(), $exp); } }