mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-26 07:42:24 +00:00
41 lines
787 B
PHP
41 lines
787 B
PHP
<?php
|
|
|
|
class Role
|
|
{
|
|
const PARTICIPANT = 0;
|
|
const ENCADRANT = 1;
|
|
const ADMIN = 2;
|
|
|
|
public static function getTranslatedName($role) {
|
|
switch ($role) {
|
|
case self::ENCADRANT:
|
|
return "Encadrant";
|
|
case self::ADMIN:
|
|
return "Administrateur";
|
|
default:
|
|
return "Participant";
|
|
}
|
|
}
|
|
|
|
public static function getName($role) {
|
|
switch ($role) {
|
|
case self::ENCADRANT:
|
|
return "ENCADRANT";
|
|
case self::ADMIN:
|
|
return "ADMIN";
|
|
default:
|
|
return "PARTICIPANT";
|
|
}
|
|
}
|
|
|
|
public static function fromName($name) {
|
|
switch ($name) {
|
|
case "ENCADRANT":
|
|
return self::ENCADRANT;
|
|
case "ADMIN":
|
|
return self::ADMIN;
|
|
default:
|
|
return self::PARTICIPANT;
|
|
}
|
|
}
|
|
} |