2

So logic is one static_content has many products.

In backend - the form for create or update a static_content, i want add a multi choices list which has all my products.

I think i should create new document(a php file) inside AcmeXXXBundle\Document\ to extend Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent and add "protected products" into it. And then i need do a mapping file or annotation in this document and make a relation between static_centent and products (one-to-many).

I'm not sure if i do above things it will be working. any suggestions are appreciated.

Wouter J
  • 41,455
  • 15
  • 107
  • 112
孙悟空
  • 1,215
  • 1
  • 11
  • 26

1 Answers1

1

There are several libraries which are created to make references between documents and entities. Ordered from the most recent and active to the least recent and active:

Wouter J
  • 41,455
  • 15
  • 107
  • 112
  • Thank your for your answer. If you know a little bit sylius, could you propose one library to start ? – 孙悟空 Nov 05 '14 at 09:51
  • they all still need a fair bit of work. they heavily leverage the event system of Doctrine. we did a lot of improvements to events in PHPCR ODM 1.2. all of the 3 above predate those efforts. at any rate, if you are motivated to work on this, I would suggest to check each of them to decide if one can be used as a basis. There is also https://github.com/Atlantic18/DoctrineExtensions/blob/master/lib/Gedmo/References/ReferencesListener.php which afaik atm only supports ORM and MongoDB ODM – Lukas Kahwe Smith Nov 05 '14 at 16:21
  • If you have questions about this don’t hesitate to contact me..I think ElectrixMaxxx is the most advanced one and I started mine only as netvlies wasn’t up to date. – hacfi Nov 06 '14 at 08:49