2011-12-14 13:55:57 +01:00
|
|
|
<?php
|
|
|
|
class SessionCiblage
|
|
|
|
{
|
2011-12-23 19:23:58 +01:00
|
|
|
protected $criteres = array('nbMPubli' , 'dirNom', 'lieuAct', 'adrDom','total', 'insee', 'siege', 'adr_cp', 'adr_dep', 'adr_com', 'tel', 'fax', 'cj', 'capital', 'ape_etab', 'ape_entrep', 'age_entrep',
|
2011-12-14 15:40:55 +01:00
|
|
|
'age_etab', 'tcaexp', 'teff_entrep', 'teff_etab', 'rang', 'actifEco', 'presentRcs', 'procolHisto', 'tvaIntraValide',
|
|
|
|
'NaceEtab', 'NaceEntrep', 'dateCrea_etab', 'dateCrea_ent', 'dateImmat', 'eff_entrep', 'eff_etab', 'rivoli', 'nbEtab',
|
|
|
|
'sirenGrp', 'nbActio', 'nbPart', 'bilType', 'bilAnnee', 'avisCs', 'bilTca', 'bilEE', 'bilFL', 'bilFK', 'bilFR', 'bilGF', 'bilGP',
|
|
|
|
'bilGU', 'bilGW', 'bilHD', 'bilHL', 'bilHM', 'bilHN', 'bilYP', 'bilFS', 'bilGG', 'bilGV', 'bilHI'
|
|
|
|
);
|
|
|
|
protected $valeur;
|
2011-12-14 13:55:57 +01:00
|
|
|
|
2011-12-14 15:40:55 +01:00
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$session = new Zend_Session_Namespace('ciblage');
|
|
|
|
$this->valeur = $session->ciblage;
|
|
|
|
}
|
2011-12-14 13:55:57 +01:00
|
|
|
|
2011-12-14 15:40:55 +01:00
|
|
|
protected function setSession()
|
|
|
|
{
|
2011-12-14 16:52:54 +01:00
|
|
|
$session = new Zend_Session_Namespace('ciblage');
|
2011-12-14 17:28:33 +01:00
|
|
|
$session->ciblage = $this->valeur;
|
2011-12-14 15:40:55 +01:00
|
|
|
}
|
2011-12-14 13:55:57 +01:00
|
|
|
|
2011-12-14 15:40:55 +01:00
|
|
|
public function setCritere($key, $value)
|
|
|
|
{
|
|
|
|
if(in_array($key, $this->criteres)) {
|
2011-12-15 10:48:45 +01:00
|
|
|
$this->valeur[$key] = $value;
|
2011-12-14 15:40:55 +01:00
|
|
|
$this->setSession();
|
|
|
|
}
|
|
|
|
}
|
2011-12-14 13:55:57 +01:00
|
|
|
|
2011-12-14 15:40:55 +01:00
|
|
|
public function setCriteres($criteres){}
|
2011-12-14 13:55:57 +01:00
|
|
|
|
2011-12-14 15:40:55 +01:00
|
|
|
public function unsetCritere($key)
|
|
|
|
{
|
|
|
|
if(key_exists($key, $this->valeur)) {
|
|
|
|
unset($this->valeur[$key]);
|
|
|
|
$this->setSession();
|
|
|
|
}
|
|
|
|
}
|
2011-12-14 13:55:57 +01:00
|
|
|
|
2011-12-29 21:33:23 +01:00
|
|
|
public function getCritere($key)
|
2011-12-14 15:40:55 +01:00
|
|
|
{
|
2011-12-29 21:35:08 +01:00
|
|
|
if(in_array($key, $this->criteres) && in_array($key, $this->valeur)) {
|
2011-12-29 21:33:23 +01:00
|
|
|
return $this->valeur[$key];
|
|
|
|
}
|
|
|
|
return null;
|
2011-12-14 15:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getCriteres()
|
|
|
|
{
|
2011-12-29 21:33:23 +01:00
|
|
|
return $this->valeur;
|
2011-12-14 15:40:55 +01:00
|
|
|
}
|
2011-12-14 13:55:57 +01:00
|
|
|
}
|