Fix conflit $result

This commit is contained in:
Michael RICOIS 2017-03-15 17:02:23 +01:00
parent 60a6c7eb67
commit 141435a398

View File

@ -1293,7 +1293,7 @@ class Entreprise extends Scores_Ws_Server
try {
$sql = "SELECT * FROM jo.liensRef WHERE id=:id";
$stmt = $this->conn->prepare($sql);
$stmt->bindValue('siren', $companyId);
$stmt->bindValue('id', $id);
$stmt->execute();
} catch(\Doctrine\DBAL\DBALException $e) {
if ($this->logger !== null) {
@ -1352,7 +1352,7 @@ class Entreprise extends Scores_Ws_Server
$nbIdNum = 3;
$refs = array();
for ($i=0;$i<$nbIdNum;$i++) {
if( !empty($result['idLoc'.$i.'Type']) ) {
if(!empty($result['idLoc'.$i.'Type'])) {
$ref = new LienRefId();
$ref->num = $result['idLoc'.$i.'Num'];
try {
@ -1361,9 +1361,9 @@ class Entreprise extends Scores_Ws_Server
$stmt->bindValue('id', $result['idLoc'.$i.'Type']);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$result = $stmt->fetch(\PDO::FETCH_OBJ);
$ref->label = $result->idLocal;
$ref->type = $result->idPrincipal;
$id = $stmt->fetch(\PDO::FETCH_OBJ);
$ref->label = $id->idLocal;
$ref->type = $id->idPrincipal;
} else {
$ref->label = '';
$ref->type = 0;