public static function getAllRelationshipsForModel($modelClassName)
    {
        $modelClassName = self::getModelClass($modelClassName);

        if (!isset(self::$relationshipCache[$modelClassName])) {
            $schemas = self::getAllSchemas();
            $relationships = [];

            foreach ($schemas as $schema) {
                if (isset($schema->relationships[$modelClassName])) {
                    $relationships = array_merge($relationships, $schema->relationships[$modelClassName]);
                }
            }

            self::$relationshipCache[$modelClassName] = $relationships;
        }

        return self::$relationshipCache[$modelClassName];
    }
public static function getAllRelationshipsForModel($modelClassName)
    {
        $modelClassName = self::getModelClass($modelClassName);

        if (!isset(self::$relationshipCache[$modelClassName])) {
            $schemas = self::getAllSchemas();
            $relationships = [];

            foreach ($schemas as $schema) {
                if (isset($schema->relationships[$modelClassName])) {
                    $relationships = array_merge($relationships, $schema->relationships[$modelClassName]);
                }
            }

            self::$relationshipCache[$modelClassName] = $relationships;
        }

        return self::$relationshipCache[$modelClassName];
    }
public static function getAllRelationshipsForModel ( $ modelClassName ) { $ modelClassName = self :: getModelClass ( $ modelClassName ) ; if ( ! isset ( self :: $ relationshipCache [ $ modelClassName ] ) ) { $ schemas = self :: getAllSchemas ( ) ; $ relationships = [ ] ; foreach ( $ schemas as $ schema ) { if ( isset ( $ schema -> relationships [ $ modelClassName ] ) ) { $ relationships = array_merge ( $ relationships , $ schema -> relationships [ $ modelClassName ] ) ; } } self :: $ relationshipCache [ $ modelClassName ] = $ relationships ; } return self :: $ relationshipCache [ $ modelClassName ] ; }
Returns all registered relationships for a given model from all registered schemas.

@param  $modelClassName
@return Relationship[]
Returns all registered relationships for a given model from all registered schemas .