odea/library/Scores/SessionCiblage.php

54 lines
1.5 KiB
PHP
Raw Normal View History

<?php
class SessionCiblage
{
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',
'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;
public function __construct()
{
$session = new Zend_Session_Namespace('ciblage');
$this->valeur = $session->ciblage;
}
protected function setSession()
{
$session = new Zend_Session_Namespace('ciblage');
2011-12-14 17:28:33 +01:00
$session->ciblage = $this->valeur;
}
public function setCritere($key, $value)
{
if(in_array($key, $this->criteres)) {
2011-12-15 10:48:45 +01:00
$this->valeur[$key] = $value;
$this->setSession();
}
}
public function setCriteres($criteres){}
public function unsetCritere($key)
{
if(key_exists($key, $this->valeur)) {
unset($this->valeur[$key]);
$this->setSession();
}
}
public function getCritere($key)
{
if(in_array($key, $this->criteres) && in_array($key, $this->valeur)) {
return $this->valeur[$key];
}
return null;
}
public function getCriteres()
{
return $this->valeur;
}
}