protected function filterAndSeparateForeignKeys($foreignKeys, $table)
    {
        $results = ['local' => [], 'remote' => []];
        foreach ($foreignKeys as $foreignKey) {
            if ($foreignKey->TABLE_NAME == $table) {
                $results['local'][] = $foreignKey;
            }
            if ($foreignKey->REFERENCED_TABLE_NAME == $table) {
                $results['remote'][] = $foreignKey;
            }
        }

        return $results;
    }
protected function filterAndSeparateForeignKeys($foreignKeys, $table)
    {
        $results = ['local' => [], 'remote' => []];
        foreach ($foreignKeys as $foreignKey) {
            if ($foreignKey->TABLE_NAME == $table) {
                $results['local'][] = $foreignKey;
            }
            if ($foreignKey->REFERENCED_TABLE_NAME == $table) {
                $results['remote'][] = $foreignKey;
            }
        }

        return $results;
    }
protected function filterAndSeparateForeignKeys ( $ foreignKeys , $ table ) { $ results = [ 'local' => [ ] , 'remote' => [ ] ] ; foreach ( $ foreignKeys as $ foreignKey ) { if ( $ foreignKey -> TABLE_NAME == $ table ) { $ results [ 'local' ] [ ] = $ foreignKey ; } if ( $ foreignKey -> REFERENCED_TABLE_NAME == $ table ) { $ results [ 'remote' ] [ ] = $ foreignKey ; } } return $ results ; }
Only show the keys where table is mentioned.

@param $foreignKeys
@param $table

@return array
Only show the keys where table is mentioned .