39 lines
860 B
PHP
39 lines
860 B
PHP
<?php
|
|
|
|
namespace mt;
|
|
|
|
use phpcommon;
|
|
|
|
class HashRate {
|
|
public static function find($id){
|
|
return getXVal(self::getMetaList(), $id, null);
|
|
}
|
|
|
|
public static function findHash($itemId){
|
|
return getXVal(self::getHashMetaList(), $itemId, null);
|
|
}
|
|
|
|
protected static function getMetaList()
|
|
{
|
|
if (!self::$metaList) {
|
|
self::$metaList = getMetaTable('HashRate@HashRate.php');
|
|
}
|
|
return self::$metaList;
|
|
}
|
|
|
|
protected static function getHashMetaList()
|
|
{
|
|
if (!self::$hashMetaList) {
|
|
self::$hashMetaList = array();
|
|
foreach (self::getMetaList() as $meta) {
|
|
self::$hashMetaList[$meta['item_id']] = $meta;
|
|
}
|
|
}
|
|
return self::$hashMetaList;
|
|
}
|
|
|
|
protected static $metaList;
|
|
protected static $hashMetaList;
|
|
|
|
}
|