Gdn_DatabaseStructure::tableExists PHP Method

tableExists() public method

Whether or not the table exists in the database.
public tableExists ( $TableName = null ) : boolean
return boolean
    public function tableExists($TableName = null)
    {
        if ($this->_TableExists === null || $TableName !== null) {
            if ($TableName === null) {
                $TableName = $this->tableName();
            }
            if (strlen($TableName) > 0) {
                $Tables = $this->Database->sql()->fetchTables(':_' . $TableName);
                $Result = count($Tables) > 0;
            } else {
                $Result = false;
            }
            if ($TableName == $this->tableName()) {
                $this->_TableExists = $Result;
            }
            return $Result;
        }
        return $this->_TableExists;
    }