plateforme-corres2math/server_files/classes/SchoolClass.php

47 lines
924 B
PHP
Raw Normal View History

<?php
class SchoolClass
{
const SECONDE = 0;
const PREMIERE = 1;
const TERMINALE = 2;
public static function getTranslatedName($class) {
switch ($class) {
2019-10-18 20:23:00 +00:00
case null:
return "Adulte";
case self::SECONDE:
return "Seconde ou inférieur";
case self::PREMIERE:
return "Première";
2019-10-18 20:23:00 +00:00
case self::TERMINALE:
return "Terminale";
}
}
public static function getName($class) {
switch ($class) {
2019-10-18 20:23:00 +00:00
case null:
return null;
case self::SECONDE:
return "SECONDE";
case self::PREMIERE:
return "PREMIERE";
2019-10-18 20:23:00 +00:00
case self::TERMINALE:
return "TERMINALE";
}
}
public static function fromName($name) {
switch ($name) {
case "SECONDE":
return self::SECONDE;
case "PREMIERE":
return self::PREMIERE;
2019-10-18 20:23:00 +00:00
case "TERMINALE":
return self::TERMINALE;
2019-10-18 20:23:00 +00:00
default:
return null;
}
}
}