Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Regard whitespace Rev 206 → Rev 207

/trunk/services/bibliotheque/nom/decorateurs/NomRangDecorateur.php
5,6 → 5,11
private $rang = null;
private $bdd = null;
private $ontologieHrefTpl = null;
protected $correspondances = array(
'rang' => 'Intitule',
'rang.code' => 'Code',
'rang.href' => 'Href',
'rang.*' => 'Intitule,Code,Href');
 
public function __construct(NomDecorateur $nomDecorateur, Bdd $bdd = null, $ontologieHrefTpl) {
$this->nomDecorateur = $nomDecorateur;
/trunk/services/bibliotheque/nom/decorateurs/NomCompoDecorateur.php
2,6 → 2,17
class NomCompoDecorateur extends NomDecorateur {
private $nomDecorateur;
protected $correspondances = array(
'nom_sci.*' => 'Compo',
'nom_sci.supra_generique', 'SupraGenre',
'nom_sci.genre' => 'Genre',
'nom_sci.infra_generique' => 'InfraGenre',
'nom_sci.sp' => 'Sp',
'nom_sci.type_epithete' => 'TypeInfraSp',
'nom_sci.infra_sp' => 'InfraSp',
'nom_sci.cultivar_groupe' => 'CultivarGroupe',
'nom_sci.cultivar' => 'Cultivar',
'nom_sci.nom_commercial' => 'NomCommercial');
public function __construct(NomDecorateur $nomDecorateur) {
$this->nomDecorateur = $nomDecorateur;
/trunk/services/bibliotheque/nom/decorateurs/NomChampsProjetDecorateur.php
3,12 → 3,27
private $nomDecorateur = null;
private $champs = array();
protected $correspondances = array();
public function __construct(NomDecorateur $nomDecorateur, Array $champs) {
$this->nomDecorateur = $nomDecorateur;
$this->champs = $champs;
$this->correspondances = array_flip($this->champs);
}
public function traiterChampsRetour(Array $champsRetour) {
foreach ($champsRetour as $champ) {
if (array_key_exists($champ, $this->correspondances)) {
$champBdd = $this->correspondances[$champ];
$champSortie = $champ;
if ($this->nomDecorateur->nom->verifierTag($champBdd)) {
$valeur = $this->nomDecorateur->nom->getTag($champBdd);
$this->nomDecorateur->nomFormate[$champSortie] = $valeur;
}
}
}
}
 
public function ajouterChampsSupplementaires() {
foreach ($this->champs as $champBdd => $champSortie) {
if ($this->nomDecorateur->nom->verifierTag($champBdd)) {
/trunk/services/bibliotheque/nom/decorateurs/NomDecorateur.php
1,13 → 1,41
<?php
class NomDecorateur {
class NomDecorateur implements NomResponsabilite {
protected $nom = null;
protected $nomFormate = array();
private $detailsHrefTpl = null;
protected $correspondances = array(
'id' => 'Id',
'nom_sci' => 'Intitule',
'href' => 'Href',
'auteur' => 'Auteur',
'annee' => 'Annee',
'biblio_origine' => 'Biblio',
'nom_addendum' => 'Addendum',
'notes' => 'Notes',
'homonyme' => 'Homonyme');
public function __construct(NomDO $nomADecorer) {
public function __construct(NomDO $nomADecorer, $detailsHrefTpl) {
$this->nom = $nomADecorer;
$this->detailsHrefTpl = $detailsHrefTpl;
$this->initialiserNomFormate();
}
public function traiterChampsRetour(Array $champsRetour) {
foreach ($champsRetour as $champ) {
if (array_key_exists($champ, $this->correspondances)) {
$methodesAExecuter = explode(',', $this->correspondances[$champ]);
foreach ($methodesAExecuter as $methodeNom) {
$methodeAjouter = 'ajouter'.$methodeNom;
if (method_exists($this, $methodeAjouter)) {
$this->$methodeAjouter();
unset($champsRetour[$champ]);
}
}
}
}
return $champsRetour;
}
 
public function ajouterId() {
$this->nomFormate['id'] = (int) $this->nom->getTag('num_nom');
}
16,6 → 44,13
$this->nomFormate['nom_sci'] = $this->nom->getTag('nom_sci');
}
public function ajouterHref() {
if ($this->nom->verifierTag('num_nom')) {
$href = sprintf($this->detailsHrefTpl, $this->nom->getTag('num_nom'));
$this->nomFormate['href'] = $href;
}
}
 
public function ajouterAuteur() {
if ($this->nom->verifierTag('auteur')) {
$this->nomFormate['auteur'] = $this->nom->getTag('auteur');
/trunk/services/bibliotheque/nom/decorateurs/NomRetenuDecorateur.php
6,6 → 6,12
private $numNomRetenu = null;
private $nomSciRetenu = null;
private $detailsHrefTpl = null;
protected $correspondances = array(
'retenu' => 'Retenu',
'nom_retenu' => 'Intitule',
'nom_retenu.id' => 'Id',
'nom_retenu.href' => 'Href',
'nom_retenu.*' => 'Intitule,Id,Href');
 
public function __construct(NomDecorateur $nomDecorateur, $detailsHrefTpl) {
$this->nomDecorateur = $nomDecorateur;
/trunk/services/bibliotheque/nom/decorateurs/NomResponsabilite.php
New file
0,0 → 1,5
<?php
interface NomResponsabilite {
public function traiterChampsRetour(Array $champsRetour);
}
?>
/trunk/services/bibliotheque/nom/decorateurs/NomBasionymeDecorateur.php
5,6 → 5,11
private $basionyme = null;
private $basionymeId = null;
private $detailsHrefTpl = null;
protected $correspondances = array(
'basionyme' => 'Intitule',
'basionyme.id' => 'Id',
'basionyme.href' => 'Href',
'basionyme.*' => 'Intitule,Id,Href');
 
public function __construct(NomDecorateur $nomDecorateur, $detailsHrefTpl) {
$this->nomDecorateur = $nomDecorateur;