Doctrine Many to Many Relationship With Extra Fields | Columns. Learn Symfony Doctrine (2021).

Поділитися
Вставка
  • Опубліковано 19 вер 2024

КОМЕНТАРІ • 37

  • @ricohumme4328
    @ricohumme4328 3 роки тому +2

    Hi Gary, thanks for this in-depth video. In the previous video leading to this one you mentioned compound foreign keys, which you forget to implement here. Current code would allow for user to have a membership to an already existing interest group at different points in time.
    Regarding your question at the beginning of the video, I'm currently keeping myself busy with testing the application, which is how I found your channel. Keep it up.

    • @GaryClarkeTech
      @GaryClarkeTech  3 роки тому +1

      I can't believe I forgot that! No-ones ever pointed it out before so thanks! I'll try to incorporate compound keys somewhere in the stuff I'm currently working on.

    • @aitorfernandez9958
      @aitorfernandez9958 2 роки тому +1

      @@GaryClarkeTech Thanks for the video, very interesting and insightful, really. But as Rico pointed out, it is quite important to have the foreign key constraints, since otherwise as he said we can't have unicity in the relations. Have you covered this anywhere? If so, (or if not), can you please point me in the right direction? Thank you!

    • @GaryClarkeTech
      @GaryClarkeTech  2 роки тому

      @@aitorfernandez9958 Hey Aitor, I've not covered compound keys using Doctrine anywhere yet. The only other person that I can imagine would cover this kind of thing is Ryan Weaver who does SymfonyCasts. You can check his stuff or ask him on twitter or something.

    • @aitorfernandez9958
      @aitorfernandez9958 2 роки тому

      @@GaryClarkeTech Hey Gary, thank you very much for your response. I did some research on my own after being left with the doubt, and actually implemented what I understand might be a valid approach to these compound primary keys.
      For anyone interested, I annotated every id i wanted to be part of the compound primary key with @ORM\Id. In my case I had two, a guid and an int, and Doctrine generated the constraints just fine, so I believe this would work for similar needs.

  • @15121Duncan
    @15121Duncan 2 роки тому

    This video was exaclty what i was looking for. It couldn't be better for me. Thank you so much!

  • @dmitryskvortsov6489
    @dmitryskvortsov6489 2 роки тому

    thank you for straightforward and easy explanation

  • @user-ys3uu5un6l
    @user-ys3uu5un6l 2 роки тому

    Garry! Thank you for the content. It's useful. If you are interested in my opinion, then for me, as a beginner, the interaction of the api with frontend is interesting. Thank you for your interest.

  • @proFFessor90
    @proFFessor90 2 роки тому

    hi, it would be nice to see a video on creating doctrine custom types and dql methods (ilike for postgres)

  • @abdelilahaassou6333
    @abdelilahaassou6333 2 роки тому

    Thank you, Gary, for this great videos. I would like to see more about APIs and projects (back+front).

  • @lazarvukosavljevic9575
    @lazarvukosavljevic9575 Рік тому

    Your videos are awesome, helped alot, thank you alot, It would be nice to increase mic for 20%

    • @GaryClarkeTech
      @GaryClarkeTech  Рік тому

      Thank you 🙏Mic is a lot better in my later recordings...this is quite an old one

  • @Michel2003g
    @Michel2003g Рік тому +1

    maby you could make the many to one one to many inside the terminal?

  • @MrWilde
    @MrWilde 3 роки тому +1

    Hey Gary, would love to see more testing with projects

    • @GaryClarkeTech
      @GaryClarkeTech  3 роки тому

      Great Robert. Lot of testing the the eCommerce project I'm doing.

  • @artan1023
    @artan1023 3 роки тому +2

    Hi Gary, that’s is a great tutorial, would it be possible to add how to create symfony forms with many-to-many relationship with extra fields?

    • @GaryClarkeTech
      @GaryClarkeTech  3 роки тому +1

      Hi Artan..it could be something I consider in the future.
      Do you have a particular scenario in mind?

    • @OKYPC
      @OKYPC 3 роки тому +2

      please @@GaryClarkeTech maybe an basic stocks scenario ([ORDER (id, date, supplier)]-[ORDER-PRODUCT(id, order_id, product_id, quantity, price)]-[PRODUCT(id, name, category)])

    • @GaryClarkeTech
      @GaryClarkeTech  3 роки тому +1

      @@OKYPC Thanks..let me think about it 👍

    • @klesk44
      @klesk44 10 місяців тому +2

      @@GaryClarkeTech hello, 2 years later, does this is out somewhere ? Thanks

  • @mairahs16
    @mairahs16 2 роки тому

    Hi Gary 😊 very useful..thank you

  • @RomanA-p6h
    @RomanA-p6h 2 роки тому

    You just have the best Symfony channel !!!
    You do not take students?

    • @GaryClarkeTech
      @GaryClarkeTech  2 роки тому

      Thanks a lot! The videos take up all of my time so there's not enough time for individual students atm

  • @杨志-n6z
    @杨志-n6z Рік тому +1

    add MemmberShip entity is the only way?

    • @GaryClarkeTech
      @GaryClarkeTech  Рік тому

      It's the only way I've ever done it using Doctrine. There might be another way but I've never explored it. ChatGPT might be able to suggest an alternative.

  • @johnfawcett3503
    @johnfawcett3503 3 роки тому

    Hi Gary, I found this and the other videos very informative - thank you very much. Is there a chance you could in future put together a video covering Symfony Forms and how you would implement the many to many relationship there? An example would be having a master (say for example user) and have the ability to select or tick items in a selectbox (example training courses completed) and have the join entity / table reflect the selected items? Would I have to resort to using Javascript to handle it or could it be done using forms?

    • @GaryClarkeTech
      @GaryClarkeTech  3 роки тому

      Thanks John..I'm glad you find them helpful.
      I've not tried your scenario using the Symfony Form component before but when I've needed inputs which relate to multiple entities of the same type, I've been able to use the name attribute like this name="course[1]" where the 1 would be a dynamically rendered id. I've done this with test inputs a few times but can't recall doing with checks .. so might be a bit more fiddly but it can be done without js. Check Matt's tutorial for ideas
      mattstauffer.com/blog/a-little-trick-for-grouping-fields-in-an-html-form/

    • @johnfawcett3503
      @johnfawcett3503 3 роки тому +1

      @@GaryClarkeTech Thanks Gary, that's given me something to look into - will take a look further and see what I can come up with! Cheers John

  • @tianadede349
    @tianadede349 2 роки тому

    thanks for videos ( ca you do creating Bundles ) ?

    • @GaryClarkeTech
      @GaryClarkeTech  2 роки тому

      Maybe some time in the future. Thanks for the suggestion 👍