/** * 获取类型定义的值(文本)内容 * @author wjh 2014-6-3 * @param array $arr * @param mixed $index index or key name * @return mixed */ public static function getValue($arr, $index) { return BDefind::getValue($arr, $index); }
/** * 刷新ActiveRecord 缓存内容 * @author wjh * @param BActiveRecord $model */ public static function refreshActiveRecordCache($model) { try { $classname = get_class($model); if (BArrayHelper::array_value_exists($classname, BCacheHelper::$CACHETYPE)) { $key = BDefind::getKeyByValue(BCacheHelper::$CACHETYPE, $classname); BCacheHelper::delete($key); } } catch (Exception $e) { } }
/** * 位幂运算 * @author wjh 20150508 * @param $key * @param $type * @return string */ public static function getBinaryInclude($type, $var) { if (empty($type) || empty($var)) { return false; } $data = array(); foreach ($var as $key => $value) { $ischecked = BDataHelper::checkBinaryInclude($key, $type); if ($ischecked) { $data[$key] = BDefind::getValue($var, $key); } } return $data; }