{"record":{"id":"03f510f58638a383","repo":"doctrine/orm","slug":"the-setschema-method-requires-the-dbal-schema-e","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/GenerateSchemaEventArgs.php","lineNumber":41,"sourceCode":"        private Schema $schema,\n    ) {\n    }\n\n    public function getEntityManager(): EntityManagerInterface\n    {\n        return $this->em;\n    }\n\n    public function getSchema(): Schema\n    {\n        return $this->schema;\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","sourceCodeStart":23,"sourceCodeEnd":50,"githubUrl":"https://github.com/doctrine/orm/blob/d9b9ff73016bf598ae07515f97289ce8074e97a5/src/Tools/Event/GenerateSchemaEventArgs.php#L23-L50","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/GenerateSchemaEventArgs.php:41 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"}