mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-29 17:51:11 +02:00
Utilisation des nouvelles classes, amélioration du code
This commit is contained in:
@ -1,15 +1,13 @@
|
||||
<?php
|
||||
|
||||
class ValidationStatus extends SplEnum
|
||||
class ValidationStatus
|
||||
{
|
||||
const __default = self::NOT_READY;
|
||||
|
||||
const NOT_READY = 0;
|
||||
const WAITING = 1;
|
||||
const VALIDATED = 2;
|
||||
|
||||
public function getName() {
|
||||
switch ($this) {
|
||||
public static function getTranslatedName($status) {
|
||||
switch ($status) {
|
||||
case self::WAITING:
|
||||
return "En attente de validation";
|
||||
case self::VALIDATED:
|
||||
@ -19,6 +17,17 @@ class ValidationStatus extends SplEnum
|
||||
}
|
||||
}
|
||||
|
||||
public static function getName($status) {
|
||||
switch ($status) {
|
||||
case self::WAITING:
|
||||
return "WAITING";
|
||||
case self::VALIDATED:
|
||||
return "VALIDATED";
|
||||
default:
|
||||
return "NOT_READY";
|
||||
}
|
||||
}
|
||||
|
||||
public static function fromName($name) {
|
||||
switch ($name) {
|
||||
case "WAITING":
|
||||
|
Reference in New Issue
Block a user