Property "xxx" in "xxx" was already declared, but it must be declared only once #5246

Open
opened 2026-01-22 15:02:31 +01:00 by admin · 0 comments
Owner

Originally created by @kricha on GitHub (Sep 11, 2016).

Originally assigned to: @Ocramius on GitHub.

[Doctrine\ORM\Mapping\MappingException] Property "user" in "Questions" was already declared, but it must be declared only once

I think there is an issue, because i can't find problem declared in error.

AppBundle\Entity\Questions:
    type: entity
    table: questions
    indexes:
        user_id:
            columns:
                - user_id
        bulk_user:
            columns:
                - bulk
                - user_id
    id:
        id:
            type: integer
            nullable: false
            options:
                unsigned: true
            generator:
                strategy: AUTO
    fields:
        ts:
            type: integer
            nullable: false
            options:
                unsigned: true
        text:
            type: text
            nullable: false
            length: 65535
            options:
                fixed: false
        bulk:
            type: boolean
            nullable: false
        anonymous:
            type: boolean
            nullable: false

    manyToOne:
        user:
            targetEntity: AppBundle\Entity\Users
            inversedBy: questions
    oneToOne:
        photos:
            targetEntity: QuestionPhotos
            mappedBy: question
        views:
            targetEntity: QuestionViews
            mappedBy: question

    oneToMany:
        answer:
            targetEntity: AppBundle\Entity\Answers
            mappedBy: question
        answersAnswered:
            targetEntity: AppBundle\Entity\AnswersAnswered
            mappedBy: question


    manyToMany:
        wizardQuestions:
            targetEntity: AppBundle\Entity\WizardQuestions
            inversedBy: questions
            joinTable:
                name: wizard_pairs
                joinColumns:
                  wq_id:
                    referencedColumnName: id
                inverseJoinColumns:
                  question_id:
                    referencedColumnName: id
    lifecycleCallbacks: {  }

doctrine/annotations                 v1.2.7  Docblock Annotations Parser
doctrine/cache                       v1.6.0  Caching library offering an object-oriented API for many cache backends
doctrine/collections                 v1.3.0  Collections Abstraction library
doctrine/common                      v2.6.1  Common Library for Doctrine projects
doctrine/dbal                        v2.5.5  Database Abstraction Layer
doctrine/doctrine-bundle             1.6.4   Symfony DoctrineBundle
doctrine/doctrine-cache-bundle       1.3.0   Symfony Bundle for Doctrine Cache
doctrine/doctrine-migrations-bundle  v1.2.0  Symfony DoctrineMigrationsBundle
doctrine/inflector                   v1.1.0  Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator                1.0.5   A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                       v1.0.1  Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations                  1.4.1   Database Schema migrations using Doctrine DBAL
doctrine/orm                         v2.5.5  Object-Relational-Mapper for PHP

So, is it issue when i am doingbin/console doctrine:mapping:import AppBundle yml --filter=Options?

Originally created by @kricha on GitHub (Sep 11, 2016). Originally assigned to: @Ocramius on GitHub. `[Doctrine\ORM\Mapping\MappingException] Property "user" in "Questions" was already declared, but it must be declared only once` I think there is an issue, because i can't find problem declared in error. ``` AppBundle\Entity\Questions: type: entity table: questions indexes: user_id: columns: - user_id bulk_user: columns: - bulk - user_id id: id: type: integer nullable: false options: unsigned: true generator: strategy: AUTO fields: ts: type: integer nullable: false options: unsigned: true text: type: text nullable: false length: 65535 options: fixed: false bulk: type: boolean nullable: false anonymous: type: boolean nullable: false manyToOne: user: targetEntity: AppBundle\Entity\Users inversedBy: questions oneToOne: photos: targetEntity: QuestionPhotos mappedBy: question views: targetEntity: QuestionViews mappedBy: question oneToMany: answer: targetEntity: AppBundle\Entity\Answers mappedBy: question answersAnswered: targetEntity: AppBundle\Entity\AnswersAnswered mappedBy: question manyToMany: wizardQuestions: targetEntity: AppBundle\Entity\WizardQuestions inversedBy: questions joinTable: name: wizard_pairs joinColumns: wq_id: referencedColumnName: id inverseJoinColumns: question_id: referencedColumnName: id lifecycleCallbacks: { } ``` ``` doctrine/annotations v1.2.7 Docblock Annotations Parser doctrine/cache v1.6.0 Caching library offering an object-oriented API for many cache backends doctrine/collections v1.3.0 Collections Abstraction library doctrine/common v2.6.1 Common Library for Doctrine projects doctrine/dbal v2.5.5 Database Abstraction Layer doctrine/doctrine-bundle 1.6.4 Symfony DoctrineBundle doctrine/doctrine-cache-bundle 1.3.0 Symfony Bundle for Doctrine Cache doctrine/doctrine-migrations-bundle v1.2.0 Symfony DoctrineMigrationsBundle doctrine/inflector v1.1.0 Common String Manipulations with regard to casing and singular/plural rules. doctrine/instantiator 1.0.5 A small, lightweight utility to instantiate objects in PHP without invoking their constructors doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers. doctrine/migrations 1.4.1 Database Schema migrations using Doctrine DBAL doctrine/orm v2.5.5 Object-Relational-Mapper for PHP ``` So, is it issue when i am doing`bin/console doctrine:mapping:import AppBundle yml --filter=Options`?
admin added the BugIncompleteMissing Tests labels 2026-01-22 15:02:31 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5246