2019-09-07 13:51:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class SchoolClass
|
|
|
|
{
|
|
|
|
const SECONDE = 0;
|
|
|
|
const PREMIERE = 1;
|
|
|
|
const TERMINALE = 2;
|
2019-12-19 12:02:01 +00:00
|
|
|
const ADULT = 3;
|
2019-09-07 13:51:16 +00:00
|
|
|
|
|
|
|
public static function getTranslatedName($class) {
|
|
|
|
switch ($class) {
|
|
|
|
case self::SECONDE:
|
|
|
|
return "Seconde ou inférieur";
|
|
|
|
case self::PREMIERE:
|
|
|
|
return "Première";
|
2019-12-19 12:02:01 +00:00
|
|
|
case self::TERMINALE:
|
2019-09-07 13:51:16 +00:00
|
|
|
return "Terminale";
|
2019-12-19 12:02:01 +00:00
|
|
|
case self::ADULT:
|
|
|
|
return "Adulte";
|
|
|
|
default:
|
|
|
|
return null;
|
2019-09-07 13:51:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getName($class) {
|
|
|
|
switch ($class) {
|
|
|
|
case self::SECONDE:
|
|
|
|
return "SECONDE";
|
|
|
|
case self::PREMIERE:
|
|
|
|
return "PREMIERE";
|
2019-12-19 12:02:01 +00:00
|
|
|
case self::TERMINALE:
|
2019-09-07 13:51:16 +00:00
|
|
|
return "TERMINALE";
|
2019-12-19 12:02:01 +00:00
|
|
|
case self::ADULT:
|
|
|
|
return "ADULT";
|
|
|
|
default:
|
|
|
|
return null;
|
2019-09-07 13:51:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function fromName($name) {
|
|
|
|
switch ($name) {
|
|
|
|
case "SECONDE":
|
|
|
|
return self::SECONDE;
|
|
|
|
case "PREMIERE":
|
|
|
|
return self::PREMIERE;
|
2019-12-19 12:02:01 +00:00
|
|
|
case "TERMINALE":
|
2019-09-07 13:51:16 +00:00
|
|
|
return self::TERMINALE;
|
2019-12-19 12:02:01 +00:00
|
|
|
case "ADULT":
|
|
|
|
return self::ADULT;
|
|
|
|
default:
|
|
|
|
return null;
|
2019-09-07 13:51:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|