39,17 → 39,30 |
} |
|
public function getBloc() { |
$this->images->setProjet('cel'); |
$donnees = array(); |
$donnees = $this->getPhoto('cel'); |
if (empty($donnees)) { |
$infos_image = $this->getCoste(); |
if (empty($infos_image) == false ){ |
$donnees['imageUrl'] = array_shift($infos_image['images']); |
} |
} |
if (empty($donnees)) { |
$donnees = $this->getPhoto('photoflora'); |
} |
return $donnees; |
} |
|
|
public function getPhoto($source) { |
$donnees = array(); |
$this->images->setProjet($source); |
$nnr = $this->nomCourant->getNnr(); |
$infos_image = $this->images->getUrlPremiereImageParIdsNoms(array($nnr)); |
if (!$infos_image || $infos_image['entete']['total'] == 0) { |
$this->images->setProjet('photoflora'); |
$nnr = $this->nomCourant->getNnr(); |
$infos_image = $this->images->getUrlPremiereImageParIdsNoms(array($nnr)); |
} |
|
if ($infos_image['resultats']) { |
$image = array_shift($infos_image['resultats']); |
$donnees['imageUrl'] = $image['binaire.href']; |
} |
return $donnees; |
} |
|