/** * @param array $queryParameters * @param array $uriParameters * @param bool $cacheResult * * @return array */ private function getResult(array $queryParameters, array $uriParameters, $cacheResult = false) { $hash = md5(serialize($queryParameters) . serialize($uriParameters)); if (isset($this->cachedResults[$hash])) { return $this->cachedResults[$hash]; } $result = $this->api->getPaginated($queryParameters, $uriParameters); if ($cacheResult) { $this->cachedResults = array(); $this->cachedResults[$hash] = $result; } return $result; }
public function __construct() { parent::__construct(); $this->_lang = $this->_getGlobalData('lang'); if (!$_REQUEST['lang'] || !array_key_exists($_REQUEST['lang'], $this->_lang)) { $this->_curLang = 1; //默认简体 } else { $this->_curLang = $_REQUEST['lang']; } }
/** * populateFromObject * * @param ApiInterface $object Should be of the same type as $this * * @return void */ public function populateFromObject(ApiInterface $object) { if ($object instanceof ApiBase) { $this->populate($object->toArray()); } }
public function __construct() { parent::__construct(); }
public function __construct() { exit('forbidden'); //屏蔽 parent::__construct(); }