From 22405f7c3428780755b278e31b91c5dca13b347c Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 19 May 2011 14:21:08 +0000 Subject: [PATCH] getIndiScore --- library/Scores/WsScores.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php index 669cedebd..8b125d177 100644 --- a/library/Scores/WsScores.php +++ b/library/Scores/WsScores.php @@ -30,6 +30,36 @@ class WsScores } } + /** + * getIndiScore + * @param string $siren + * @param string $nic + * @param integer $niveau + * @param boolean $plus + */ + public function getIndiScore($siren, $nic=0, $niveau=2, $plus=false) + { + $params = new stdClass(); + $params->siren = $siren; + $params->nic = $nic; + $params->niveau = $niveau; + $params->plus = $plus + $filename = 'getindiscore-'.$nic.'-'.$niveau; + $cache = new Cache($filename); + if ($cache->exist() && !$this->toNotCache ){ + return $cache->getBlock('element'); + } + $client = $this->loadClient('entreprise'); + try { + $reponse = $client->getIndiScore($params); + $cache->deletefile(); + $cache->setBlock('marques', $reponse->getIndiScoreResult); + return $reponse->getIndiScoreResult; + } catch (SoapFault $fault) { + return false; + } + } + /** * setLog * @param string $page