Fonction d'extraction

This commit is contained in:
Damien LASSERRE 2012-02-21 12:58:44 +00:00
parent ef01f0d618
commit bc1a47cc5c

View File

@ -89,4 +89,26 @@ class Object_Comptage extends Libs_Row
);
return (json_encode($result));
}
public function extract()
{
require_once 'Scores/SessionCiblage.php';
require_once 'Scores/Field.php';
require_once 'Scores/Ciblage.php';
$session = new SessionCiblage();
$sessionValeur = $session->getCritere($key);
$field = new Fields();
$ciblage = new Ciblage($field->getValues());
$resultats = $ciblage->execute(true);
$total = array(
'total' => count($resultats),
'insee' => $ciblage->calculRedevanceInsee(),
'result'=> $resultats
);
foreach ($total['result']['matches'] as $element) {
$siret[] = $element['attrs']['siren'].$element['attrs']['nic'];
}
return ($siret);
}
}