| 163 |
jpm |
1 |
<?php
|
|
|
2 |
class Ressources {
|
|
|
3 |
|
|
|
4 |
private $ressources = array();
|
|
|
5 |
|
|
|
6 |
public function __construct(Array $ressources) {
|
|
|
7 |
$this->ressources = $ressources;
|
|
|
8 |
}
|
|
|
9 |
|
|
|
10 |
public function getParPosition($position) {
|
|
|
11 |
$valeur = '';
|
|
|
12 |
if (array_key_exists($position, $this->ressources)) {
|
|
|
13 |
$valeur = $this->ressources[$position];
|
|
|
14 |
}
|
|
|
15 |
return $valeur;
|
|
|
16 |
}
|
|
|
17 |
|
|
|
18 |
public function getNombre() {
|
|
|
19 |
return count($this->ressources);
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
public function getProjetNom() {
|
|
|
23 |
return $this->getParPosition(0);
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
public function getServiceNom() {
|
|
|
27 |
return $this->getParPosition(1);
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
public function getDetailsId() {
|
|
|
31 |
return (int) $this->getParPosition(2);
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
public function etreId($aTester) {
|
|
|
35 |
$etreId = is_numeric($aTester) ? true : false;
|
|
|
36 |
return $etreId;
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
public function etreStats($aTester) {
|
|
|
40 |
$etreStats = $aTester == 'stats' ? true : false;
|
|
|
41 |
return $etreStats;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
public function etreTypeDeStats($aTester) {
|
|
|
45 |
$typesStats = array('annees', 'rangs', 'initiales');
|
|
|
46 |
$etreStatsType = in_array($aTester, $typesStats) ? true : false;
|
|
|
47 |
return $etreStatsType;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
public function etreRelations($aTester) {
|
|
|
51 |
$etreRelations = $aTester == 'relations' ? true : false;
|
|
|
52 |
return $etreRelations;
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
public function etreTypeDeRelations($aTester) {
|
|
|
56 |
$typesRelations = array('synonymie', 'homonymie', 'flores');
|
|
|
57 |
$etreRelationsType = in_array($aTester, $typesRelations) ? true : false;
|
|
|
58 |
return $etreRelationsType;
|
|
|
59 |
}
|
|
|
60 |
}
|
|
|
61 |
?>
|