doctrine/orm · error · BadMethodCallException

The setClassTable() method requires the DBAL Schema::edit()

Error message

The setClassTable() method requires the DBAL Schema::edit() API which is not available in the current DBAL version. This feature requires doctrine/dbal ^4.5 or higher.

What it means

Error "The setClassTable() method requires the DBAL Schema::edit() API which is not available in the current DBAL version. This feature requires doctrine/dbal ^4.5 or higher." thrown in doctrine/orm.

Source

Thrown at src/Tools/Event/GenerateSchemaTableEventArgs.php:63

    public function setSchema(Schema $schema): void
    {
        // @phpstan-ignore function.impossibleType (Checking for unreleased Schema::edit() API)
        if (! method_exists(Schema::class, 'edit')) {
            throw new BadMethodCallException(
                'The setSchema() method requires the DBAL Schema::edit() API which is not available in the current DBAL version. '
                . 'This feature requires doctrine/dbal ^4.5 or higher.',
            );
        }

        $this->schema = $schema;
    }

    public function setClassTable(Table $classTable): void
    {
        // @phpstan-ignore function.impossibleType (Checking for unreleased Schema::edit() API)
        if (! method_exists(Schema::class, 'edit')) {
            throw new BadMethodCallException(
                'The setClassTable() method requires the DBAL Schema::edit() API which is not available in the current DBAL version. '
                . 'This feature requires doctrine/dbal ^4.5 or higher.',
            );
        }

        $this->classTable           = $classTable;
        $this->classTableWasMutated = true;
    }

    public function classTableWasMutated(): bool
    {
        return $this->classTableWasMutated;
    }
}

View on GitHub (pinned to d9b9ff7301)

When it happens

Trigger: Thrown at src/Tools/Event/GenerateSchemaTableEventArgs.php:63 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of doctrine/orm@d9b9ff7301 (2026-08-21). Data as JSON: /api/errors/804d9a92fbe7a2e1. Report an issue: GitHub.