src/mako/database/midgard/relations/Relation.php
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();
	}
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();
	}
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 ( ) ; }
Eager loads records in chunks.

@param  array                            $keys Parent keys
@return \mako\database\midgard\ResultSet
Eager loads records in chunks .