ImportModel::processImportDb PHP Method

processImportDb() public method

Process the import tables from the database.
public processImportDb ( )
    public function processImportDb()
    {
        // Grab a list of all of the tables.
        $TableNames = $this->SQL->FetchTables(':_z%');
        if (count($TableNames) == 0) {
            throw new Gdn_UserException('Your database does not contain any import tables.');
        }
        $Tables = array();
        foreach ($TableNames as $TableName) {
            $TableName = stringBeginsWith($TableName, $this->Database->DatabasePrefix, true, true);
            $DestTableName = stringBeginsWith($TableName, 'z', true, true);
            $TableInfo = array('Table' => $DestTableName);
            $ColumnInfos = $this->SQL->FetchTableSchema($TableName);
            $Columns = array();
            foreach ($ColumnInfos as $ColumnInfo) {
                $Columns[GetValue('Name', $ColumnInfo)] = Gdn::structure()->ColumnTypeString($ColumnInfo);
            }
            $TableInfo['Columns'] = $Columns;
            $Tables[$DestTableName] = $TableInfo;
        }
        $this->Data['Tables'] = $Tables;
        return true;
    }