I'm working with createjs, createphp and the CreateBundle on the Symfony CMF Sandbox (http://cmf.liip.ch
The goal is to build a news list where it is possible to create news with createjs. This is very similar to what has been done for the CMF Website (https://github.com/symfony-cmf/symfony-cmf-website/pull/9
). The difference is the way data are organized in the repository (using PHPCR). On the CMF Website, the SimpleCmsBundle is used, and has one single tree node for the content, menu and routes, all under /cms/simple. But with the sandbox, there is a tree for content, one for the routes and one for the menu, under /cms/content, /cms/routes and /cms/menu.
So, in the Sandbox, when we want to create a news, we need to save the news content in the repository (PHPCR), and then the route. The route needs to have a link to the content. It is then needed to wait for the content creation to be able to set the correct relation.
I want to do this as far as possible in the frontend. When a new document is saved successfully, I thought about creating another request to send to the backend, with the subject of the document just created. For that, I guess I need to overwrite the midgardstoragesaved event. I still need to figure out how I can get the subject that comes with the http response of the document creation...
What do you think about this approach? Would you recommand another technique to store two differente entities that still have a link between them?
Thanks for your help!