Retrieve the values of multiple keys

@param array $keys

@return \Traversable|null
@throws exDataMalformed|exIOError|exInvalidKey
965313
function getFromKeys(array $keys)
    {
        try {
            $c = $this->collection->find(
                [
                    'key'   => [ '$in' => array_values($keys) ],
                    'realm' => $this->getRealm(),
                ]
                , [ 'typeMap' => self::$typeMap ] // override typeMap option
            );

            foreach ($c as $d) {
                $key     = $d['key'];
                $val     = $this->getDataInterchange()->retrieveBackward( $d['value'] );

                parent::set($key, $val);
                yield $key => $val;
            }

        } catch (\Exception $e) {
            throw new exReadError($e->getMessage(), $e->getCode(), $e);
        }
    }
419101
public function many(array $keys)
    {
        $values = $this->store->many(collect($keys)->map(function ($value, $key) {
            return is_string($key) ? $key : $value;
        })->values()->all());

        return collect($values)->map(function ($value, $key) use ($keys) {
            return $this->handleManyResult($keys, $key, $value);
        })->all();
    }
573857
public static function fromKeys($keys){
        $hash = new Dictionary();
        foreach($keys as $key){
            $hash[$key] = NULL;
        }
        return $hash;
    }
756511
protected function mapKeysToIds($keys): array
    {
        $this->assertIterable($keys, 'keys not iterable');

        $map = [];

        foreach ($keys as $key) {
            $id = $this->keyToId($key);
            $map[$id] = $key;
        }

        return $map;
    }
1304504
public function findByKeys(array $keys)
    {
        $result = [];
        /** @var Cursor $list */
        $list = $this->collection->find(['_id' => ['$in' => $keys]]);

        foreach ($list as $document) {
            $result[] = $this->hydrateEntity($document);
        }

        return $result;
    }
463891
public function pick($keys = null)
    {
        if ($keys === null) {
            $attributes = static::getMapper()->getAttributes();
            $keys = [];

            foreach ($attributes as $key => $attribute) {
                if (!$attribute['protected']) {
                    $keys[] = $key;
                }
            }
        } else {
            $keys = is_array($keys) ? $keys : func_get_args();
        }

        $values = [];
        foreach ($keys as $key) {
            if (array_key_exists($key, $this->values)) {
                $values[$key] = $this->get($key);
            }
        }

        return $values;
    }
687152
public function getMultiple($keys)
	{
		$items = array();
		$success = false;
		$values = apc_fetch($keys, $success);

		if ($success && is_array($values))
		{
			foreach ($values as $key => $value)
			{
				// @todo - identify the value when a cache item is not found.
				$items[$key] = new Item($key);
				$items[$key]->setValue($value);
			}
		}

		return $items;
	}
942779
public static function keysExist ($array, $keys)
		{
			if (!is_array($array))
				return null;

			if (!is_array($keys))
				$keys = [ $keys ];

			foreach ($keys as $key)
				if (!array_key_exists($key, $array))
					return false;

			return true;
		}
1093076
public function many(array $keys)
    {
        $return = [];

        $prefixedKeys = array_map(function ($key) {
            return $this->prefix . $key;
        }, $keys);

        $values = $this->connection()->mGet($prefixedKeys);

        foreach ($values as $index => $value) {
            $return[$keys[$index]] = is_numeric($value) ? $value : unserialize($value);
        }

        return $return;
    }
248773
protected function getKeys( $rows, $key ) {

        if ( count( $rows ) > 0 && !$rows[ 0 ]->hasProperty( $key ) ) {

            throw new \LogicException( '"' . $key . '" does not exist in "' . $this->table . '" result' );

        }

        $keys = array();

        foreach ( $rows as $row ) {

            if ( $row->__isset( $key ) ) {

                $keys[] = $row->__get( $key );

            }

        }

        return array_values( array_unique( $keys ) );

    }
73727
public function mget(array $keys)
	{
		$items = array();

		foreach ($keys as $key) {
		    $items[$key] = $this->get($key);
		}
		
		return $items;
	}
576613
public function getMulti(array $keys)
    {
        $results = array();
        foreach ($keys as $key) {
            $results[$key] = $this->get($key);
        }
        return $results;
    }
1077194
public function only(array $keys): array
    {
        $return = [];
        foreach ($keys as $key) {
            $value = $this->get($key);
            if (!is_null($value)) {
                $return[$key] = $value;
            }
        }
        return $return;
    }
941258
private function getQueryOptions(string ...$keys) : array
    {
        return array_filter(
            array_intersect_key($this->query, array_flip($keys)),
            static function ($value) {
                return $value !== null;
            }
        );
    }
1263243
public function getMany(array $keys)
    {
        $values = $this->connection()->mget($this->prefixKeys($keys));

        return array_combine($keys, array_map(function ($value) {
            return is_numeric($value) ? $value : unserialize($value);
        }, $values));
    }
252324
public function all( $keys = null ) {
		$input = array_replace_recursive( $this->input(), $this->all_files() );

		if ( ! $keys ) {
			return $input;
		}

		$results = [];

		foreach ( is_array( $keys ) ? $keys : func_get_args() as $key ) {
			Arr::set( $results, $key, Arr::get( $input, $key ) );
		}

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

        $newArray = array();

        foreach($keys as $key) {
            if (isset($this->_data[$key])) {
                $newArray[$key] = $this->_data[$key];
            }
        }

        return $newArray;
    }