src/Relations/Relation.php
protected function load_from_cache( Model $model ) {

		$cached = wp_cache_get( $model->get_pk(), $this->get_cache_group() );

		if ( $cached === false ) {
			return null;
		}

		if ( is_array( $cached ) ) {
			return $this->load_collection_from_cache( $cached, $model );
		} else {
			return $this->load_single_from_cache( $cached );
		}
	}
protected function load_from_cache( Model $model ) {

		$cached = wp_cache_get( $model->get_pk(), $this->get_cache_group() );

		if ( $cached === false ) {
			return null;
		}

		if ( is_array( $cached ) ) {
			return $this->load_collection_from_cache( $cached, $model );
		} else {
			return $this->load_single_from_cache( $cached );
		}
	}
Load the results of a relation from the cache.

@since 2.0

@param Model $model

@return Collection|Model|mixed|null