getIndiScore

This commit is contained in:
Michael RICOIS 2011-05-19 14:21:08 +00:00
parent 06a97530c2
commit 22405f7c34

View File

@ -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