2019-09-09 23:48:52 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Role
|
|
|
|
{
|
|
|
|
const PARTICIPANT = 0;
|
|
|
|
const ENCADRANT = 1;
|
2019-09-11 16:41:45 +00:00
|
|
|
const ADMIN = 2;
|
2019-09-09 23:48:52 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|