Entreprise - getLiens : remove Application_Model

This commit is contained in:
Michael RICOIS 2017-03-15 14:53:12 +01:00
parent 64a9931738
commit cbae95cf2b

View File

@ -831,31 +831,32 @@ class Entreprise extends Scores_Ws_Server
$this->permission('liens');
//Load country table
try {
$countryM = new Application_Model_JoTabPays();
$sql = $countryM->select()->from($countryM, array('codPays3', 'libPays'));
$result = $countryM->fetchAll($sql);
} catch (Zend_Db_Adapter_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
} catch (Zend_Exception $e) {
throw new SoapFault('ERR', "Application error");
try {
$sql = "SELECT codPays3, libPays FROM jo.tabPays";
$stmt = $this->conn->prepare($sql);
$stmt->execute();
} catch(\Doctrine\DBAL\DBALException $e) {
if ($this->logger !== null) {
$this->logger->error($e->getMessage());
}
if ($this->User->idClient == 1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
$tabPays = array();
if ( $result->count()>0 ) {
foreach ( $result as $item ) {
if ($stmt->count() > 0) {
while ($item = $stmt->fetch(\PDO::FETCH_OBJ)) {
$tabPays[$item->codPays3] = $item->libPays;
}
}
$tabAct = $tabPar = $tabDir = array();
try
{
try {
$liensM = new Metier_Liens_Base();
$liensM->setId($siren, 'siren');