New file |
0,0 → 1,61 |
<?php |
class Ressources { |
|
private $ressources = array(); |
|
public function __construct(Array $ressources) { |
$this->ressources = $ressources; |
} |
|
public function getParPosition($position) { |
$valeur = ''; |
if (array_key_exists($position, $this->ressources)) { |
$valeur = $this->ressources[$position]; |
} |
return $valeur; |
} |
|
public function getNombre() { |
return count($this->ressources); |
} |
|
public function getProjetNom() { |
return $this->getParPosition(0); |
} |
|
public function getServiceNom() { |
return $this->getParPosition(1); |
} |
|
public function getDetailsId() { |
return (int) $this->getParPosition(2); |
} |
|
public function etreId($aTester) { |
$etreId = is_numeric($aTester) ? true : false; |
return $etreId; |
} |
|
public function etreStats($aTester) { |
$etreStats = $aTester == 'stats' ? true : false; |
return $etreStats; |
} |
|
public function etreTypeDeStats($aTester) { |
$typesStats = array('annees', 'rangs', 'initiales'); |
$etreStatsType = in_array($aTester, $typesStats) ? true : false; |
return $etreStatsType; |
} |
|
public function etreRelations($aTester) { |
$etreRelations = $aTester == 'relations' ? true : false; |
return $etreRelations; |
} |
|
public function etreTypeDeRelations($aTester) { |
$typesRelations = array('synonymie', 'homonymie', 'flores'); |
$etreRelationsType = in_array($aTester, $typesRelations) ? true : false; |
return $etreRelationsType; |
} |
} |
?> |