[Doc] OneToMany information #5212

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

Originally created by @alborq on GitHub (Aug 7, 2016).

onetomany is define as independant annotation :
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#onetomany

But, In reality onetomany can not exist itself this need a mapped side :

       /**
         * @ORM\OneToMany(targetEntity="AppBundle\Entity\OnePrimary")
         * @ORM\JoinColumn(name="linked_reverse_to_one1_n_id")
         *
         * @var OnePrimary[]|ArrayCollection
         */
        private $linkedReverseToOne1N;

OneToMany mapping on field 'linkedReverseToOne1N' requires the 'mappedBy' attribute.

Doc say mappedBy is optional attributes: AND cascade arg exist, but if OneToMany is only inversedSide

When a bidirectional assocation is updated, Doctrine only checks on one of both sides for these changes. This is called the owning side of the association.

cascade cant be listen

Originally created by @alborq on GitHub (Aug 7, 2016). onetomany is define as independant annotation : http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#onetomany But, In reality onetomany can not exist itself this need a mapped side : ``` /** * @ORM\OneToMany(targetEntity="AppBundle\Entity\OnePrimary") * @ORM\JoinColumn(name="linked_reverse_to_one1_n_id") * * @var OnePrimary[]|ArrayCollection */ private $linkedReverseToOne1N; ``` OneToMany mapping on field 'linkedReverseToOne1N' requires the 'mappedBy' attribute. Doc say mappedBy is optional attributes: AND cascade arg exist, but if OneToMany is only inversedSide > When a bidirectional assocation is updated, Doctrine only checks on one of both sides for these changes. This is called the owning side of the association. cascade cant be listen
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5212