DDC-3329: Comment on clumn is passed when creating self-reference association #4114

Open
opened 2026-01-22 14:35:24 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Sep 28, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user s.todorov:

The example below will pass the comment from the column *group_id* to parent_id. Unfortunately that is not what I would like because the comment would confuse that parent_id has the same purpose as group_id which is not the case.

class Group {

    /****
     * @var integer
     *
     * @ORM\Id
     * @ORM\Column(name="group_id", type="integer", options={"comment" = "This column is a relation to atable.z, btable.y, rtable.k, or whatever long comment we have here."})
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /****
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /****
     * @var integer
     *
     * @ORM\JoinColumn(name="parent*id", referencedColumnName="group*id", nullable=true)
     * @ORM\ManyToOne(targetEntity="Acme\MyBundle\Entity\Group")
     */
    private $parent;

    /****
     * Get id
     *
     * @return integer
     */
    public function getId() {
        return $this->id;
    }

    /****
     * Get name
     *
     * @return string
     */
    public function getName() {
        return $this->name;
    }

    /****
     * Set name
     *
     * @param string $name
     *
     * @return Group
     */
    public function setName( $name ) {
        $this->name = $name;

        return $this;
    }

    /****
     * Get parent
     *
     * @return Group
     */
    public function getParent() {
        return $this->parent;
    }

    /****
     * Set parent
     *
     * @param Group $parent
     *
     * @return Group
     */
    public function setParent( Group $parent ) {
        $this->parent = $parent;

        return $this;
    }
}
Originally created by @doctrinebot on GitHub (Sep 28, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user s.todorov: The example below will pass the comment from the column **group_id\* to _parent_id_. Unfortunately that is not what I would like because the comment would confuse that _parent_id_ has the same purpose as *group_id** which is not the case. ``` class Group { /**** * @var integer * * @ORM\Id * @ORM\Column(name="group_id", type="integer", options={"comment" = "This column is a relation to atable.z, btable.y, rtable.k, or whatever long comment we have here."}) * @ORM\GeneratedValue(strategy="IDENTITY") */ private $id; /**** * @var string * * @ORM\Column(name="name", type="string", length=255) */ private $name; /**** * @var integer * * @ORM\JoinColumn(name="parent*id", referencedColumnName="group*id", nullable=true) * @ORM\ManyToOne(targetEntity="Acme\MyBundle\Entity\Group") */ private $parent; /**** * Get id * * @return integer */ public function getId() { return $this->id; } /**** * Get name * * @return string */ public function getName() { return $this->name; } /**** * Set name * * @param string $name * * @return Group */ public function setName( $name ) { $this->name = $name; return $this; } /**** * Get parent * * @return Group */ public function getParent() { return $this->parent; } /**** * Set parent * * @param Group $parent * * @return Group */ public function setParent( Group $parent ) { $this->parent = $parent; return $this; } } ```
admin added the Bug label 2026-01-22 14:35:24 +01:00
Author
Owner

@doctrinebot commented on GitHub (Oct 19, 2014):

Comment created by @ocramius:

[~s.todorov] can you rephrase the issue? What's the DDL for that table? And What exactly is broken about it?

@doctrinebot commented on GitHub (Oct 19, 2014): Comment created by @ocramius: [~s.todorov] can you rephrase the issue? What's the DDL for that table? And What exactly is broken about it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4114