private function getForeignKeysToArray($database, $tblName, $oCol = '')
    {
        if (!isset($this->advCache['tableFKs'][$database][$tblName])) {
            $this->setTableForeignKeyCache($database, $this->fixTableSource($tblName));
        }
        $aRt = [];
        if (isset($this->advCache['tableFKs'][$database][$tblName])) {
            $cnm = ['COLUMN_NAME', 'full_array_key_numbered', 'REFERENCED_TABLE_SCHEMA', 'REFERENCED_TABLE_NAME'];
            foreach ($this->advCache['tableFKs'][$database][$tblName] as $val) {
                if ($val[$cnm[0]] == $oCol) {
                    $vlQ        = array_merge($val, ['LIMIT' => 2]);
                    $tFd        = $this->setMySQLquery2Server($this->getForeignKeysQuery($vlQ), $cnm[1])['result'];
                    $tgtFld     = '`' . ($tFd[0][$cnm[0]] == $val[$cnm[0]] ? $tFd[1][$cnm[0]] : $tFd[0][$cnm[0]]) . '`';
                    $aRt[$oCol] = [$this->glueDbTb($val[$cnm[2]], $val[$cnm[3]]), $val[$cnm[2]], $tgtFld];
                }
            }
        }
        return $aRt;
    }
private function getForeignKeysToArray($database, $tblName, $oCol = '')
    {
        if (!isset($this->advCache['tableFKs'][$database][$tblName])) {
            $this->setTableForeignKeyCache($database, $this->fixTableSource($tblName));
        }
        $aRt = [];
        if (isset($this->advCache['tableFKs'][$database][$tblName])) {
            $cnm = ['COLUMN_NAME', 'full_array_key_numbered', 'REFERENCED_TABLE_SCHEMA', 'REFERENCED_TABLE_NAME'];
            foreach ($this->advCache['tableFKs'][$database][$tblName] as $val) {
                if ($val[$cnm[0]] == $oCol) {
                    $vlQ        = array_merge($val, ['LIMIT' => 2]);
                    $tFd        = $this->setMySQLquery2Server($this->getForeignKeysQuery($vlQ), $cnm[1])['result'];
                    $tgtFld     = '`' . ($tFd[0][$cnm[0]] == $val[$cnm[0]] ? $tFd[1][$cnm[0]] : $tFd[0][$cnm[0]]) . '`';
                    $aRt[$oCol] = [$this->glueDbTb($val[$cnm[2]], $val[$cnm[3]]), $val[$cnm[2]], $tgtFld];
                }
            }
        }
        return $aRt;
    }
private function getForeignKeysToArray ( $ database , $ tblName , $ oCol = '' ) { if ( ! isset ( $ this -> advCache [ 'tableFKs' ] [ $ database ] [ $ tblName ] ) ) { $ this -> setTableForeignKeyCache ( $ database , $ this -> fixTableSource ( $ tblName ) ) ; } $ aRt = [ ] ; if ( isset ( $ this -> advCache [ 'tableFKs' ] [ $ database ] [ $ tblName ] ) ) { $ cnm = [ 'COLUMN_NAME' , 'full_array_key_numbered' , 'REFERENCED_TABLE_SCHEMA' , 'REFERENCED_TABLE_NAME' ] ; foreach ( $ this -> advCache [ 'tableFKs' ] [ $ database ] [ $ tblName ] as $ val ) { if ( $ val [ $ cnm [ 0 ] ] == $ oCol ) { $ vlQ = array_merge ( $ val , [ 'LIMIT' => 2 ] ) ; $ tFd = $ this -> setMySQLquery2Server ( $ this -> getForeignKeysQuery ( $ vlQ ) , $ cnm [ 1 ] ) [ 'result' ] ; $ tgtFld = '`' . ( $ tFd [ 0 ] [ $ cnm [ 0 ] ] == $ val [ $ cnm [ 0 ] ] ? $ tFd [ 1 ] [ $ cnm [ 0 ] ] : $ tFd [ 0 ] [ $ cnm [ 0 ] ] ) . '`' ; $ aRt [ $ oCol ] = [ $ this -> glueDbTb ( $ val [ $ cnm [ 2 ] ] , $ val [ $ cnm [ 3 ] ] ) , $ val [ $ cnm [ 2 ] ] , $ tgtFld ] ; } } } return $ aRt ; }
Returns an array with fields referenced by a Foreign key

@param string $database
@param string $tblName
@param string|array $oCol Only column(s) considered
@return array
Returns an array with fields referenced by a Foreign key