meraproject/module/vcard/item/structure/eVcardItemCurrency.php

34 lines
745 B
PHP
Raw Normal View History

<?php
namespace vcard\item\structure;
class eVcardItemCurrency {
const RUB = 1;
const USD = 2;
const EURO = 3;
const TENGE = 4;
static $arr;
static function getArray(){
if(self::$arr) return self::$arr;
return self::$arr = [
self::RUB => ['n'=>'₽'],
self::USD => ['n'=>'$'],
self::EURO => ['n'=>'€'],
self::TENGE => ['n'=>'₸'],
];
}
static function getCurrency($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;
}
}