src/Relations/Relation.php
protected function cache_collection( Collection $collection, Model $model ) {

		$ids = array_map( function ( $e ) use ( $collection ) {
			return $collection->get_saver()->get_pk( $e );
		}, $collection->toArray() );

		wp_cache_set( $model->get_pk(), $ids, $this->get_cache_group() );
	}
protected function cache_collection( Collection $collection, Model $model ) {

		$ids = array_map( function ( $e ) use ( $collection ) {
			return $collection->get_saver()->get_pk( $e );
		}, $collection->toArray() );

		wp_cache_set( $model->get_pk(), $ids, $this->get_cache_group() );
	}
Cache a collection of results.

@since 2.0

@param Collection $collection
@param Model      $model