Get all or a subset of matching key value pairs

@param array $keys Pass an array of keys to retrieve only a subset of key value pairs

@return array Returns an array of all matching key value pairs
344624
public function getAll(array $keys = null)
    {
        return $keys ? array_intersect_key($this->data, array_flip($keys)) : $this->data;
    }
1207980
public function getMany(array $keys)
    {
        $preserve = defined(get_class($this->memcached).'::GET_PRESERVE_ORDER') ? constant(get_class($this->memcached).'::GET_PRESERVE_ORDER') : null;
        $tokens = null;

        $values = $this->memcached->getMulti($this->prefixKeys($keys), $tokens, $preserve);

        if ($this->memcached->getResultCode() === 0) {
            return $values;
        }
    }
1226193
public function getNamesByKey($keys)
    {
        if (empty($keys)) {
            return [];
        }

        return $this->whereIn($this->getKeyName(), $keys)
                    ->select('name')->get()
                    ->pluck('name')->all();
    }
49781
public function toArray(array $keys = [])
    {
        $data = parent::toArray($keys);

        if (in_array('url', $keys) || empty($keys)) {
            $data['url'] = $this->getUrl();
        }

        if (in_array('is_selected', $keys) || empty($keys)) {
            $data['is_selected'] = (bool) $this->getIsSelected();
        }

        return $data;
    }
383701
public function getMany($keys)
    {
        $config = [];

        foreach ($keys as $key => $default) {
            if (is_numeric($key)) {
                [$key, $default] = [$default, null];
            }

            $config[$key] = Arr::get($this->items, $key, $default);
        }

        return $config;
    }
932278
public function getMany($keys)
    {
        if (!is_array($keys))
            $keys = func_get_args();

        $newArray = array();

        foreach($keys as $key) {
            if (isset($_SESSION[$key])) {
                $newArray[$key] = $_SESSION[$key];
            }
        }

        return $newArray;
    }
1290768
protected function read(array $keys)
    {
        $_res = array();
        $res = apc_fetch($keys);
        foreach ($res as $k => $v) {
            $_res[$k] = $v;
        }

        return $_res;
    }
776589
public function only($keys)
    {
        $keys = is_array($keys) ? $keys : func_get_args();

        $results = [];

        $input = $this->all();

        foreach ($keys as $key) {
            Arr::set($results, $key, data_get($input, $key));
        }

        return $results;
    }
157698
public static function filterKeys ($array, $keys)
		{
			if (is_array($array))
			{
				$return = [];
				if (!is_array($keys))
					$keys = [ $keys ];
				foreach ($keys as $key)
					if (isset($array[ $key ]))
						$return[ $key ] = $array[ $key ];

				return $return;
			}

			return null;
		}
241170
private function filterByKeys(array $keys)
    {
        $results = [];

        foreach ($this->items as $key => $value) {
            if (!in_array($key, $keys)) {
                continue;
            }

            $results[$key] = $value;
        }

        return $results;
    }
1175752
public function only($keys)
    {
        if (is_null($keys)) {
            return new static($this->items);
        }

        return new static(array_intersect_key($this->items, array_flip((array)$keys)));
    }
538895
public function getTextFromArray(array $keys = [])
    {
        $values = [];
        foreach ($keys as $key) {
            $values[$key] = $this->getText($key);
        }
        return $values;
    }
296355
public function items(array $keys = null): array
    {
        if ($keys != null) {
            $return = [];
            foreach ($keys as $key) {
                $return[$key] = $this->get($key);
            }
        } else {
            $return = $this->data;
        }

        return $return;
    }
546140
public function getMultiple($keys)
    {
        $value = [];
        foreach ($keys as $key) {
            $value[$key] = self::get($key, $default);
        }

        return $value;
    }
711325
function getFromKeys(array $keys)
    {
        $result = [];
        try {
            foreach ($keys as $key)
            {
                $result[] = $this->get($key);
            }
        } catch (\Exception $e) {
            throw new exReadError($e->getMessage(), $e->getCode(), $e);
        }
    }
941144
protected function read(array $keys)
    {
        $_keys = $lookup = array();
        foreach ($keys as $k) {
            $_k = sha1($k);
            $_keys[] = $_k;
            $lookup[$_k] = $k;
        }
        $_res = array();
        $res = $this->memcache->get($_keys);
        foreach ($res as $k => $v) {
            $_res[$lookup[$k]] = $v;
        }

        return $_res;
    }
906577
public function except($keys)
    {
        $keys = is_array($keys) ? $keys : [$keys];
        $all = $this->all();

        foreach ($keys as $key) {
            if (array_key_exists($key, $all)) {
                unset($all[$key]);
            }
        }

        return $all;
    }