function GetForeignKeys($table)
    {
        $sql = new Sql\Builder($this);
        $fields = array('TABLE_SCHEMA', 'TABLE_NAME', 'REFERENCED_COLUMN_NAME', 'CONSTRAINT_NAME');
        
        $tbl = $sql->Table('information_schema.key_column_usage', $fields);
        
        $where = $sql->Equals($tbl->Field('TABLE_SCHEMA'), $sql->Value($this->dbName))->
                And_($sql->Equals($tbl->Field('TABLE_NAME'), $sql->Value($table)))->
                And_($sql->IsNotNull($tbl->Field('REFERENCED_COLUMN_NAME')));
        $what = $sql->SelectList($tbl->Field('CONSTRAINT_NAME'));
        
        
        $select = $sql->Select(true, $what, $tbl, $where);
        $result = array();
        $reader = $this->ExecuteQuery((string)$select);
        while ($reader->Read())
        {
            $result[] = $reader->ByIndex(0);
        }
        return $result;
    }
function GetForeignKeys($table)
    {
        $sql = new Sql\Builder($this);
        $fields = array('TABLE_SCHEMA', 'TABLE_NAME', 'REFERENCED_COLUMN_NAME', 'CONSTRAINT_NAME');
        
        $tbl = $sql->Table('information_schema.key_column_usage', $fields);
        
        $where = $sql->Equals($tbl->Field('TABLE_SCHEMA'), $sql->Value($this->dbName))->
                And_($sql->Equals($tbl->Field('TABLE_NAME'), $sql->Value($table)))->
                And_($sql->IsNotNull($tbl->Field('REFERENCED_COLUMN_NAME')));
        $what = $sql->SelectList($tbl->Field('CONSTRAINT_NAME'));
        
        
        $select = $sql->Select(true, $what, $tbl, $where);
        $result = array();
        $reader = $this->ExecuteQuery((string)$select);
        while ($reader->Read())
        {
            $result[] = $reader->ByIndex(0);
        }
        return $result;
    }
function GetForeignKeys ( $ table ) { $ sql = new Sql \ Builder ( $ this ) ; $ fields = array ( 'TABLE_SCHEMA' , 'TABLE_NAME' , 'REFERENCED_COLUMN_NAME' , 'CONSTRAINT_NAME' ) ; $ tbl = $ sql -> Table ( 'information_schema.key_column_usage' , $ fields ) ; $ where = $ sql -> Equals ( $ tbl -> Field ( 'TABLE_SCHEMA' ) , $ sql -> Value ( $ this -> dbName ) ) -> And_ ( $ sql -> Equals ( $ tbl -> Field ( 'TABLE_NAME' ) , $ sql -> Value ( $ table ) ) ) -> And_ ( $ sql -> IsNotNull ( $ tbl -> Field ( 'REFERENCED_COLUMN_NAME' ) ) ) ; $ what = $ sql -> SelectList ( $ tbl -> Field ( 'CONSTRAINT_NAME' ) ) ; $ select = $ sql -> Select ( true , $ what , $ tbl , $ where ) ; $ result = array ( ) ; $ reader = $ this -> ExecuteQuery ( ( string ) $ select ) ; while ( $ reader -> Read ( ) ) { $ result [ ] = $ reader -> ByIndex ( 0 ) ; } return $ result ; }
Gets the identifiers of all foreign keys
@param string $table The table the foreign keys are searched for
@return string[] Returns all foreign key identifiers for a table
Gets the identifiers of all foreign keys