src/Model.php
public function get_all_relations() {

		if ( isset( static::$_relation_attribute_cache[ get_class( $this ) ] ) ) {
			return static::$_relation_attribute_cache[ get_class( $this ) ];
		}

		$relations = array();
		$methods   = get_class_methods( $this );

		foreach ( $methods as $method ) {
			preg_match( '/^_(\S+)_relation$/', $method, $matches );

			if ( empty( $matches[1] ) ) {
				continue;
			}

			$relations[] = $matches[1];
			$matches     = null;
		}

		static::$_relation_attribute_cache[ get_class( $this ) ] = $relations;

		return $relations;
	}
public function get_all_relations() {

		if ( isset( static::$_relation_attribute_cache[ get_class( $this ) ] ) ) {
			return static::$_relation_attribute_cache[ get_class( $this ) ];
		}

		$relations = array();
		$methods   = get_class_methods( $this );

		foreach ( $methods as $method ) {
			preg_match( '/^_(\S+)_relation$/', $method, $matches );

			if ( empty( $matches[1] ) ) {
				continue;
			}

			$relations[] = $matches[1];
			$matches     = null;
		}

		static::$_relation_attribute_cache[ get_class( $this ) ] = $relations;

		return $relations;
	}
Get all relations this model has.

Will be cached on subsequent runs.

@since 2.0

@return array