44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace mt;
|
|
|
|
use phpcommon;
|
|
|
|
class PayMethod
|
|
{
|
|
|
|
public static function getPayMethods($token_type)
|
|
{
|
|
self::cachePayMethodsInTokenType();
|
|
$methods = getXVal(self::$cachePayMethodsInTokenTypeList, $token_type, null);
|
|
return $methods;
|
|
|
|
}
|
|
|
|
protected static function cachePayMethodsInTokenType()
|
|
{
|
|
if (!self::$cachePayMethodsInTokenTypeList) {
|
|
self::$cachePayMethodsInTokenTypeList = array();
|
|
foreach (self::getMetaList() as $meta) {
|
|
if (!getXVal(self::$cachePayMethodsInTokenTypeList, $meta['shop_token_type'], null)) {
|
|
self::$cachePayMethodsInTokenTypeList[$meta['shop_token_type']] = array();
|
|
}
|
|
array_push(self::$cachePayMethodsInTokenTypeList[$meta['shop_token_type']], $meta);
|
|
}
|
|
}
|
|
|
|
return self::$cachePayMethodsInTokenTypeList;
|
|
}
|
|
|
|
protected static function getMetaList()
|
|
{
|
|
if (!self::$metaList) {
|
|
self::$metaList = getMetaTable('payMethod@payMethod.php');
|
|
}
|
|
return self::$metaList;
|
|
}
|
|
|
|
protected static $cachePayMethodsInTokenTypeList;
|
|
protected static $metaList;
|
|
}
|