New file |
0,0 → 1,44 |
<?php |
class NomBasionymeDecorateur extends NomDecorateur { |
|
private $nomDecorateur = null; |
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; |
$this->detailsHrefTpl = $detailsHrefTpl; |
if ($this->nomDecorateur->nom->verifierTag('basionyme')) { |
$this->basionymeId = $this->nomDecorateur->nom->getTag('basionyme'); |
} |
if ($this->nomDecorateur->nom->verifierTag('nb_nom_sci')) { |
$this->basionyme = $this->nomDecorateur->nom->getTag('nb_nom_sci'); |
} |
} |
|
public function ajouterId() { |
if (is_null($this->basionymeId) === false) { |
$this->nomDecorateur->nomFormate['basionyme.id'] = $this->basionymeId; |
} |
} |
|
public function ajouterHref() { |
if (is_null($this->basionymeId) === false) { |
$href = sprintf($this->detailsHrefTpl, $this->basionymeId); |
$this->nomDecorateur->nomFormate['basionyme.href'] = $href; |
} |
} |
|
public function ajouterIntitule() { |
if (is_null($this->basionyme) === false) { |
$this->nomDecorateur->nomFormate['basionyme'] = $this->basionyme; |
} |
} |
} |
?> |