Returns only the models from the collection with the specified keys.

@param  mixed $keys
@return static
173159
public function only( $keys )
	{
		$dictionary = Arr::only( $this->getDictionary(), $keys );

		return new static( array_values( $dictionary ) );
	}
36439
public function pick(array $keys) {
        $data = [];

        foreach ($keys as $key) {
            array_set($data, $key, $this->get($key));
        }

        return $data;
    }
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)));
    }
314590
public function mget($keys)
	{
	    $res = [];
	    if (is_array($keys)) {
	        foreach ($keys as $k) {
	            $res[$k] = $this->get($k);
	        }
	    } else {
	        $res[$keys] = $this->get($keys);
	    }
	    
	    return $res;
	}
145060
public function filterByPrimaryKeys($keys)
    {
        if (empty($keys)) {
            return $this->add(null, '1<>1', Criteria::CUSTOM);
        }
        foreach ($keys as $key) {
            $cton0 = $this->getNewCriterion(StructureNodeParentTableMap::COL_STRUCTURE_NODE_ID, $key[0], Criteria::EQUAL);
            $cton1 = $this->getNewCriterion(StructureNodeParentTableMap::COL_PARENT_ID, $key[1], Criteria::EQUAL);
            $cton0->addAnd($cton1);
            $this->addOr($cton0);
        }

        return $this;
    }
97243
public function filterByPrimaryKeys($keys)
    {
        if (empty($keys)) {
            return $this->add(null, '1<>1', Criteria::CUSTOM);
        }
        foreach ($keys as $key) {
            $cton0 = $this->getNewCriterion(UserRoleTableMap::COL_USER_ID, $key[0], Criteria::EQUAL);
            $cton1 = $this->getNewCriterion(UserRoleTableMap::COL_ROLE_ID, $key[1], Criteria::EQUAL);
            $cton0->addAnd($cton1);
            $this->addOr($cton0);
        }

        return $this;
    }
32472
public function only($keys = null)
    {
        $keys = is_array($keys) ? $keys : func_get_args();
        return array_only($this->params, $keys);
    }
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();
    }
258942
public function filterByPrimaryKeys($keys)
    {
        if (empty($keys)) {
            return $this->add(null, '1<>1', Criteria::CUSTOM);
        }
        foreach ($keys as $key) {
            $cton0 = $this->getNewCriterion(C2MTableMap::COL_CATEGORY_ID, $key[0], Criteria::EQUAL);
            $cton1 = $this->getNewCriterion(C2MTableMap::COL_MEDIA_ID, $key[1], Criteria::EQUAL);
            $cton0->addAnd($cton1);
            $this->addOr($cton0);
        }

        return $this;
    }
441397
public function getMany(array $keys)
    {
        return array_merge(array_fill_keys($keys, null), Arr::only($this->storage, $this->prefixKeys($keys)));
    }
1250023
public function whereKeysLike($patterns)
    {
        if (! $patterns instanceof Collection) {
            $patterns = new Collection((array) $patterns);
        }

        /* @var Collection $patterns */

        if ($patterns->filter()->isEmpty()) {
            return new static($this->all());
        }

        /**
         * Return a subset of pairs that match any of the given patterns.
         */
        return $this->pairs()->filter(function (LineInterface $line) use ($patterns) {
            return $patterns->contains(function ($index, $pattern) use ($line) {
                return fnmatch($pattern, $line->key());
            });
        });
    }
150786
public function only($keys)
    {
        if (is_null($keys)) {

            return new static($this->items);
        }

        $keys = is_array($keys) ? $keys : func_get_args();

        return new static(ArrayHelper::only($this->items, $keys));
    }
391857
public function except($keys): Collection
    {
        $keys = is_array($keys) ? $keys : func_get_args();
        return new static(ArrayHelper::except($this->items, $keys));
    }
756233
protected function iteratorToArray($keys)
    {
        // Already array
        if (is_array($keys)) {
            return $keys;
        }

        // Handle iterable
        if ($keys instanceof Traversable) {
            return iterator_to_array($keys, false);
        }

        // Error
        $keysType = is_object($keys) ? get_class($keys) : gettype($keys);
        throw new InvalidArgumentException("Cache keys must be array or Traversable, \"{$keysType}\" given");
    }
1087678
public function replaceKeys(array $keys): self
    {
        $values = \array_values($this->getArray());
        $result = \array_combine($keys, $values);

        return static::create(
            $result,
            $this->iteratorClass,
            false
        );
    }
1346886
public function only($keys)
    {
        if (is_null($keys)) {
            return new static($this->items);
        }

        $dictionary = Arr::only($this->getDictionary(), $keys);

        return new static(array_values($dictionary));
    }
301770
private function getRecord(array $keys)
    {
        $keys['_timeout'] = ['$gt' => time()];

        $results = $this->getCollection()->find($keys);

        if ($results->hasNext()) {
            return $results->getNext();
        }
    }