src/Controller/Component/SetupComponent.php
public function tableExists($tableName, $connectionName = 'default')
    {
        try {
            $db = ConnectionManager::get($connectionName);
            $collection = $db->schemaCollection();
            $tables = $collection->listTables();
            if (in_array($tableName, $tables)) {
                return true;
            }
        } catch (PDOException $connectionError) {
            return false;
        }
        return false;
    }
public function tableExists($tableName, $connectionName = 'default')
    {
        try {
            $db = ConnectionManager::get($connectionName);
            $collection = $db->schemaCollection();
            $tables = $collection->listTables();
            if (in_array($tableName, $tables)) {
                return true;
            }
        } catch (PDOException $connectionError) {
            return false;
        }
        return false;
    }
public function tableExists ( $ tableName , $ connectionName = 'default' ) { try { $ db = ConnectionManager :: get ( $ connectionName ) ; $ collection = $ db -> schemaCollection ( ) ; $ tables = $ collection -> listTables ( ) ; if ( in_array ( $ tableName , $ tables ) ) { return true ; } } catch ( PDOException $ connectionError ) { return false ; } return false ; }
Check whether table is exists in database or not.

@param string $tableName Name of the table to check.
@param string $connectionName Connection to use
@return bool True if table exists, False else.
Check whether table is exists in database or not .