{"record":{"id":"c7bded36083a94b3","repo":"doctrine/orm","slug":"type-of-association-must-be-one-of-to-one-or-man","errorCode":null,"errorMessage":"Type of association must be one of *_TO_ONE or MANY_TO_MANY","messagePattern":"Type of association must be one of \\*_TO_ONE or MANY_TO_MANY","errorType":"exception","errorClass":"BadMethodCallException","httpStatus":null,"severity":"error","filePath":"src/Query/SqlWalker.php","lineNumber":1054,"sourceCode":"                if ($discrSql) {\n                    $conditions[] = $discrSql;\n                }\n\n                // Apply the filters\n                $filterExpr = $this->generateFilterConditionSQL($targetClass, $targetTableAlias);\n\n                if ($filterExpr) {\n                    $conditions[] = $filterExpr;\n                }\n\n                $targetTableJoin = [\n                    'table' => $targetTableName . ' ' . $targetTableAlias,\n                    'condition' => implode(' AND ', $conditions),\n                ];\n                break;\n\n            default:\n                throw new BadMethodCallException('Type of association must be one of *_TO_ONE or MANY_TO_MANY');\n        }\n\n        // Handle WITH clause\n        $withCondition = $condExpr === null ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')');\n\n        if ($targetClass->isInheritanceTypeJoined()) {\n            $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias);\n            // If we have WITH condition, we need to build nested joins for target class table and cti joins\n            if ($withCondition && $ctiJoins) {\n                $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition'];\n            } else {\n                $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins;\n            }\n        } else {\n            $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'];\n        }\n\n        if ($withCondition) {","sourceCodeStart":1036,"sourceCodeEnd":1072,"githubUrl":"https://github.com/doctrine/orm/blob/d9b9ff73016bf598ae07515f97289ce8074e97a5/src/Query/SqlWalker.php#L1036-L1072","documentation":"Error \"Type of association must be one of *_TO_ONE or MANY_TO_MANY\" thrown in doctrine/orm.","triggerScenarios":"Thrown at src/Query/SqlWalker.php:1054 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"}