src/Model.php
protected function get_relation_value( $attribute ) {

		if ( array_key_exists( $attribute, $this->_relations ) ) {
			return $this->_relations[ $attribute ];
		}

		$relation = $this->get_relation( $attribute );
		$this->set_relation_value( $attribute, $relation->get_results() );

		return $this->get_relation_value( $attribute );
	}
protected function get_relation_value( $attribute ) {

		if ( array_key_exists( $attribute, $this->_relations ) ) {
			return $this->_relations[ $attribute ];
		}

		$relation = $this->get_relation( $attribute );
		$this->set_relation_value( $attribute, $relation->get_results() );

		return $this->get_relation_value( $attribute );
	}
Get a relation's value.

Will load from the cache if possible. Otherwise, will get the relation controller and retrieve and
cache the results.

@since 2.0

@param string $attribute Relation name.

@return Collection|Model|mixed