Eager loads records in chunks.

@param  array                            $keys Parent keys
@return \mako\database\midgard\ResultSet
964237
protected function eagerLoadChunked(array $keys)
	{
		if(count($keys) > static::EAGER_LOAD_CHUNK_SIZE)
		{
			$records = [];

			foreach(array_chunk($keys, static::EAGER_LOAD_CHUNK_SIZE) as $chunk)
			{
				$query = clone $this;

				$records = array_merge($records, $query->eagerCriterion($chunk)->all()->getItems());
			}

			return $this->createResultSet($records);
		}

		return $this->eagerCriterion($keys)->all();
	}
1273690
private function iteratorFromKeys(array $keys)
    {
        $values = [];
        $key    = ($this->request->qtype === 'eq')
            ? $this->request->key
            : null;

        foreach ($keys as $value) {
            $entry = new IndexEntry();

            $entry->indexKey  = $key;
            $entry->objectKey = $value;

            $values[] = $entry;
        }

        return new ArrayIterator($values);
    }
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;
    }
463556
public function from(...$tables)
    {
        foreach ($tables as $table)
        {
            if (is_string($table))
            {
                $this->storageFrom[$table] = $table;
                continue;
            }

            $key  = key($table);
            $item = current($table); // RawQuery

            $this->storageFrom[$key] = $item;
        }

        return $this;
    }
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));
    }
345851
public function getMany(array $keys)
    {
        $cache = $this->table()->whereIn('key', $this->prefixKeys($keys))->get()->keyBy('key');

        $cached = [];
        $expired = [];
        foreach ($keys as $key) {
            $item = $cache->get($this->getPrefix().$key);

            if (time() >= data_get($item, 'expiration')) {
                if (! is_null($item)) {
                    $expired[] = $key;
                }
                $cached[$key] = null;
                continue;
            }

            $cached[$key] = $this->encrypter->decrypt(data_get($item, 'value'));
        }

        if (! empty($expired)) {
            $this->forgetMany($expired);
        }

        return $cached;
    }
1002130
public function process(array $items)
    {
        foreach ($items as $key => $item) {
            $items[$key] = $this->doClean($item);
        }

        return $items;
    }
653306
private function cacheIsset($keys)
    {
        $has   = false;
        $array = $this->cache;

        foreach ($keys as $key) {
            if ($has = array_key_exists($key, $array)) {
                $array = $array[$key];
            }
        }

        if (is_array($array)) {
            $has = $has && array_key_exists(0, $array);
        }

        return $has;
    }
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;
    }
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;
        }
    }
927407
public function mdelete($keys){
		//$this->queries_mset_count++;
		$result=true;
		foreach($keys as $key){
			$r=$this->delete($key);
			$result=$result & $r;
			}
		return $result;
		}
1059900
public function eagerLoadRelations(array $models)
	{
		foreach ($this->eagerLoad as $name => $constraints)
		{
			// For nested eager loads we'll skip loading them here and they will be set as an
			// eager load on the query to retrieve the relation so that they will be eager
			// loaded on that query, because that is where they get hydrated as models.
			if (strpos($name, '.') === false)
			{
				$models = $this->loadRelation($models, $name, $constraints);
			}
		}

		return $models;
	}
1199619
public function hasKeys(array $keys): array
    {
        $list = [];
        foreach ($keys as $key) {
            $list[$key] = $this->hasKey((string)$key);
        }

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

        return $this;
    }
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");
    }
745007
protected function getAnyKey(array $keys)
    {
        foreach($keys as $key)
        {
            $value = $this->getValue($key);

            if(!is_null($value))
            {
                return $value;
            }
        }
    }
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();
    }