doctrine/orm · error · BadMethodCallException
The setSchema() method requires the DBAL Schema::edit() API
Error message
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.
What it means
Error "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." thrown in doctrine/orm.
Source
Thrown at src/Tools/Event/GenerateSchemaTableEventArgs.php:50
{
return $this->classMetadata;
}
public function getSchema(): Schema
{
return $this->schema;
}
public function getClassTable(): Table
{
return $this->classTable;
}
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.',
);
}
View on GitHub (pinned to d9b9ff7301)
When it happens
Trigger: Thrown at src/Tools/Event/GenerateSchemaTableEventArgs.php:50 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/f74fbdb8df50c50f.
Report an issue: GitHub.