doctrine/orm · error · InvalidArgumentException

The column '%s' conflicts with another column in the mapper.

Error message

The column '%s' conflicts with another column in the mapper.

What it means

Error "The column '%s' conflicts with another column in the mapper." thrown in doctrine/orm.

Source

Thrown at src/Query/ResultSetMappingBuilder.php:125

     * @phpstan-param array<string, string> $columnAliasMap
     *
     * @throws InvalidArgumentException
     */
    protected function addAllClassFields(string $class, string $alias, array $columnAliasMap = []): void
    {
        $classMetadata = $this->em->getClassMetadata($class);
        $platform      = $this->em->getConnection()->getDatabasePlatform();

        if (! $this->isInheritanceSupported($classMetadata)) {
            throw new InvalidArgumentException('ResultSetMapping builder does not currently support your inheritance scheme.');
        }

        foreach ($classMetadata->getColumnNames() as $columnName) {
            $propertyName = $classMetadata->getFieldName($columnName);
            $columnAlias  = $this->getSQLResultCasing($platform, $columnAliasMap[$columnName]);

            if (isset($this->fieldMappings[$columnAlias])) {
                throw new InvalidArgumentException(sprintf(
                    "The column '%s' conflicts with another column in the mapper.",
                    $columnName,
                ));
            }

            $this->addFieldResult($alias, $columnAlias, $propertyName);

            $enumType = $classMetadata->getFieldMapping($propertyName)->enumType ?? null;
            if (! empty($enumType)) {
                $this->addEnumResult($columnAlias, $enumType);
            }
        }

        foreach ($classMetadata->associationMappings as $associationMapping) {
            if ($associationMapping->isToOneOwningSide()) {
                $targetClass  = $this->em->getClassMetadata($associationMapping->targetEntity);
                $isIdentifier = isset($associationMapping->id) && $associationMapping->id === true;

View on GitHub (pinned to d9b9ff7301)

When it happens

Trigger: Thrown at src/Query/ResultSetMappingBuilder.php:125 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/ca6abed832e10e1c. Report an issue: GitHub.