PHP DoctrineORM one-to-many self-referencing association 014

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

ความคิดเห็น • 13

  • @VisioX2K
    @VisioX2K 5 ปีที่แล้ว

    Good video as usual!
    I seem to miss the part where the child or the parent is getting the reference (aka. referencedColumnId) to the actual ID field.
    If it is done within actual PHP code, you might skipped showing it.
    ...or maybe I am just confused, which happens frequently :-)

    • @Beachcasts
      @Beachcasts  5 ปีที่แล้ว

      That is an interesting question I didn't speak about. The convention within Doctrine associations is that the column an association is added to, through annotations, automatically looks for an "id" column in the associated entity. If there is not an "id" column it would require an added annotation specifying the column to use with the foreign key. Such as:
      @JoinColumn(name="parent_id", referencedColumnName="id")
      I'll make sure to mention this in a future video when I do the ManyToOne associations.

    • @VisioX2K
      @VisioX2K 5 ปีที่แล้ว

      @@Beachcasts Thank you Adam, for clarifying! That was the missing link.

    • @Beachcasts
      @Beachcasts  5 ปีที่แล้ว

      Happy to help.

  • @Cellenta
    @Cellenta 3 ปีที่แล้ว +1

    I had struggeling for a self refrencing entity. Your Video helped me a lot. Thank you!

    • @Beachcasts
      @Beachcasts  3 ปีที่แล้ว

      So happy to help. Thank you for watching.

  • @pierrebrier7002
    @pierrebrier7002 5 ปีที่แล้ว

    THX for tips !

    • @Beachcasts
      @Beachcasts  5 ปีที่แล้ว

      Thank you for the comment. Glad you found it helpful.

  • @justeat4498
    @justeat4498 2 ปีที่แล้ว

    Hi can I convert it in spring boot ..if it's possible it's help me lot..

  • @MahdiHaghgoo
    @MahdiHaghgoo 5 ปีที่แล้ว

    Would you please do a video on different PHP IDEs comparison?

    • @Beachcasts
      @Beachcasts  5 ปีที่แล้ว +1

      Thanks for the idea. Do you have any IDEs you're considering, or would like to know about?

    • @MahdiHaghgoo
      @MahdiHaghgoo 5 ปีที่แล้ว

      @@Beachcasts Yes, Those I know of include Apache Netbeans which has got a new look and growth recently, also PhpStorm which I am using, and Eclipse, etc.

    • @Beachcasts
      @Beachcasts  5 ปีที่แล้ว +1

      Thanks. Let me see what I can do in the future. At the moment I use PhpStorm, and have not used the others for a long time.