public function createRelationships($table, $relationships, $check_exist = false, $return_schema = false)
    {
        $relationships = static::validateAsArray(
            $relationships,
            ',',
            true,
            'The request contains no valid table relationship names or properties.'
        );

        $out = [];
        foreach ($relationships as $relationship) {
            $name = (is_array($relationship)) ? array_get($relationship, 'name') : $relationship;
            $this->validateSchemaAccess($table, Verbs::PUT);
            $out[] = $this->createRelationship($table, $name, $relationship, $check_exist, $return_schema);
        }

        return $out;
    }
public function createRelationships($table, $relationships, $check_exist = false, $return_schema = false)
    {
        $relationships = static::validateAsArray(
            $relationships,
            ',',
            true,
            'The request contains no valid table relationship names or properties.'
        );

        $out = [];
        foreach ($relationships as $relationship) {
            $name = (is_array($relationship)) ? array_get($relationship, 'name') : $relationship;
            $this->validateSchemaAccess($table, Verbs::PUT);
            $out[] = $this->createRelationship($table, $name, $relationship, $check_exist, $return_schema);
        }

        return $out;
    }
public function createRelationships ( $ table , $ relationships , $ check_exist = false , $ return_schema = false ) { $ relationships = static :: validateAsArray ( $ relationships , ',' , true , 'The request contains no valid table relationship names or properties.' ) ; $ out = [ ] ; foreach ( $ relationships as $ relationship ) { $ name = ( is_array ( $ relationship ) ) ? array_get ( $ relationship , 'name' ) : $ relationship ; $ this -> validateSchemaAccess ( $ table , Verbs :: PUT ) ; $ out [ ] = $ this -> createRelationship ( $ table , $ name , $ relationship , $ check_exist , $ return_schema ) ; } return $ out ; }
Create multiple table relationships

@param string $table
@param array  $relationships
@param bool   $check_exist
@param bool   $return_schema Return a refreshed copy of the schema from the database

@throws \Exception
@return array
Create multiple table relationships