public function getTableDef($tablename) {
        $ltablename = strtolower($tablename);

        // Check to see if the table isn't in the cache first.
        if ($this->allTablesFetched & Db::FETCH_TABLENAMES &&
            !isset($this->tables[$ltablename])) {
            return null;
        }

        if (
            isset($this->tables[$ltablename]) &&
            is_array($this->tables[$ltablename]) &&
            isset($this->tables[$ltablename]['columns'], $this->tables[$ltablename]['indexes'])
        ) {
            return $this->tables[$ltablename];
        }
        return [];
    }