/** * getStatLgth * * @param int $hid * @return array */ public function getStatLgth($hid) { $lgth = $this->getStatDays($hid); if (!isset($lgth['len']) || !is_array($lgth = $lgth['len'])) { return array(); } $maps = getStatLgths(); $lgth = array_combine($lgth, str_replace(array_keys($maps), $maps, $lgth)); return $lgth; }
/** * getStatLgthNameByCode * * @param mixed $code * @return mixed */ function getStatLgthNameByCode($code) { $names = getStatLgths(); return isset($names[$code]) ? $names[$code] : null; }