每天laravel-20160626|RetrievesMultipleKeys

来源:互联网 发布:知乎离线下载 编辑:程序博客网 时间:2024/05/21 06:51
<?phpnamespace Illuminate\Cache;// a namespacetrait RetrievesMultipleKeys{// has a name Retrieves Multiple Keys    /**     * Retrieve multiple items from the cache by key.     *     * Items not found in the cache will have a null value.     *     * @param  array  $keys     * @return array     */    public function many(array $keys)// Retrieve multiple items from the cache by key.    {// items not found in the cache will have a null value.        $return = [];// a store array        foreach ($keys as $key) {            $return[$key] = $this->get($key);        }// a set get        return $return;// a return    }// get many value    /**     * Store multiple items in the cache for a given number of minutes.     *     * @param  array  $values     * @param  int  $minutes     * @return void     */    public function putMany(array $values, $minutes)// Store multiple items in the cache for a given number of minutes.    {        foreach ($values as $key => $value) {            $this->put($key, $value, $minutes);        }    }// a big set putMany}
0 0