meraproject/themes/merakomis/project/structure/eStatus.php

37 lines
784 B
PHP
Raw Normal View History

<?php
namespace themes\merakomis\project\structure;
class eStatus {
const NONE = 0;
const WORKING = 1;
const FINISH = 2;
const PAUSE = 3;
static $arr;
static function getArray(){
return self::$arr ? : self::$arr = [
self::NONE => ['n'=>'Не определён'],
self::WORKING => ['n'=>'В работе'],
self::FINISH => ['n'=>'Завершён'],
self::PAUSE => ['n'=>'Пауза'],
];
}
static function getName($x){
return self::getArray()[$x]['n'];
}
static function getNameList(){
$res = [];
$a = self::getArray();
foreach ($a as $k=>$v){
$res[] = ['id'=>$k,'title'=>$v['n']];
}
return $res;
}
}