{"record":{"id":"f74fbdb8df50c50f","repo":"doctrine/orm","slug":"the-setschema-method-requires-the-dbal-schema-e-f74fbd","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"exception","errorClass":"BadMethodCallException","httpStatus":null,"severity":"error","filePath":"src/Tools/Event/GenerateSchemaTableEventArgs.php","lineNumber":50,"sourceCode":"    {\n        return $this->classMetadata;\n    }\n\n    public function getSchema(): Schema\n    {\n        return $this->schema;\n    }\n\n    public function getClassTable(): Table\n    {\n        return $this->classTable;\n    }\n\n    public function setSchema(Schema $schema): void\n    {\n        // @phpstan-ignore function.impossibleType (Checking for unreleased Schema::edit() API)\n        if (! method_exists(Schema::class, 'edit')) {\n            throw new BadMethodCallException(\n                'The setSchema() method requires the DBAL Schema::edit() API which is not available in the current DBAL version. '\n                . 'This feature requires doctrine/dbal ^4.5 or higher.',\n            );\n        }\n\n        $this->schema = $schema;\n    }\n\n    public function setClassTable(Table $classTable): void\n    {\n        // @phpstan-ignore function.impossibleType (Checking for unreleased Schema::edit() API)\n        if (! method_exists(Schema::class, 'edit')) {\n            throw new BadMethodCallException(\n                'The setClassTable() method requires the DBAL Schema::edit() API which is not available in the current DBAL version. '\n                . 'This feature requires doctrine/dbal ^4.5 or higher.',\n            );\n        }\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/doctrine/orm/blob/d9b9ff73016bf598ae07515f97289ce8074e97a5/src/Tools/Event/GenerateSchemaTableEventArgs.php#L32-L68","documentation":"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.","triggerScenarios":"Thrown at src/Tools/Event/GenerateSchemaTableEventArgs.php:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9b9ff73016bf598ae07515f97289ce8074e97a5","analyzedAt":"2026-08-21T06:13:15.863Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}