2019-09-05 17:07:59 +00:00
|
|
|
<?php
|
|
|
|
|
2019-09-06 23:33:05 +00:00
|
|
|
class ValidationStatus
|
2019-09-05 17:07:59 +00:00
|
|
|
{
|
|
|
|
const NOT_READY = 0;
|
|
|
|
const WAITING = 1;
|
|
|
|
const VALIDATED = 2;
|
|
|
|
|
2019-09-06 23:33:05 +00:00
|
|
|
public static function getTranslatedName($status) {
|
|
|
|
switch ($status) {
|
2019-09-05 17:07:59 +00:00
|
|
|
case self::WAITING:
|
|
|
|
return "En attente de validation";
|
|
|
|
case self::VALIDATED:
|
|
|
|
return "Inscription validée";
|
|
|
|
default:
|
|
|
|
return "Inscription non terminée";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 23:33:05 +00:00
|
|
|
public static function getName($status) {
|
|
|
|
switch ($status) {
|
|
|
|
case self::WAITING:
|
|
|
|
return "WAITING";
|
|
|
|
case self::VALIDATED:
|
|
|
|
return "VALIDATED";
|
|
|
|
default:
|
|
|
|
return "NOT_READY";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-05 17:07:59 +00:00
|
|
|
public static function fromName($name) {
|
|
|
|
switch ($name) {
|
|
|
|
case "WAITING":
|
|
|
|
return self::WAITING;
|
|
|
|
case "VALIDATED":
|
|
|
|
return self::VALIDATED;
|
|
|
|
default:
|
|
|
|
return self::NOT_READY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|