This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » eZ Publish 5 Platform » Questions on developing a Symfony2...

Questions on developing a Symfony2 custom app with Ez Publish 5

Questions on developing a Symfony2 custom app with Ez Publish 5

Monday 14 January 2013 6:42:04 pm - 4 replies

Firstly, congratulations on coming this far with the phased migration over to Symfony2. It's truly exciting.

After reading through all the docs, even the legacy ez4 docs, I am not totally clear on how to approach the development of a custom symfony2 application in ez5, when there are custom entities besides the built in blog/forum/gallery/contact form, etc.

For example:

1. Can/should all entities in an application be created and managed inside the ez5 repository (eg.for a Hotel Reservation system, should we place all our custom entities and associations in the ez5 repository, like: Hotel, Room, Rate, RateType, RoomOccupancy, Reservations, ReservationTypes, etc.)? Or, are some entity groupings better left in the Doctrine ORM?

2. If some entities should be left in the ORM, how can they be associated with User, Attachments, Comments and Gallery which is managed in the ez5 Repository (and vice versa, if I want to find all of a User's reservations and the hotel rooms he has rented, how do you do that when the association spans the ez5 repository, and the Doctrine ORM) ?

3. Is there any relationship between ez5 and Doctrine (even dbal) or is ez5 built completely separately on it's own custom repository (ie. do symfony2 developers who are familiar with Doctrine, need to learn a totally new persistence api to store and retrieve data?)

4. Do you have any example of a simple crud app (eg. a simple job board, or classified ads board) with custom entities built with symfony2 that runs with ez5 (and uses ez5 Users, Attachments, Comments, etc.) which people can play with (ie. until the ez4 legacy admin and all the front UI stuff is migrated to Symfony2, how should Symfony2 developers be building their admin sections and forms, to integrate with ez5)?

5. Is there any plan to leverage more of the Symfony cmf, than only the chained router?

6. Is it correct to say that if we built an app on top of ez5, with all our entities in the ez5 repo - we would automatically inherit all the ez5 content management features on our own "custom" content, like: Solr full text search, automatic admin section,  automatic REST api,  versioning and i8n, etc?

7. If we need custom admin pages, how do we integrate that with the current admin which is not in Symfony2? Same question goes with modifying the login forms, or other parts of the ez5 UI?

8. I read in the legacy ez4 documentation that there is no ACID properties in the repo, so that if you added or removed a field on an entity in a large database, you could corrupt the database if the web request timed out. That is pretty scary - database integrity is a big issue. A timeout of a request should not corrupt a database, that is pretty drastic. Can you please clarify?

Thanks very much and really looking forward to seeing this development evolve.

Modified on Monday 14 January 2013 6:45:16 pm by Keymaster Keymaster

Monday 14 January 2013 8:45:48 pm


Great questions, and I don't have full answers. But Brandon Chambers of our team did write a tutorial for building custom controllers for eZ Publish 5; his tutorial was written with the consultation of eZ Systems engineer Jérôme Vieilledent. This may give you a sense of how development on top of eZ Publish 5/Symfony is intended.

There's also a visual of the architecture here which might be a little helpful.

You may also find Jérôme's series of blog posts on eZ Publish 5 useful.

Peace and all good,


Modified on Monday 14 January 2013 8:46:19 pm by Greg McAvoy-Jensen

Monday 14 January 2013 11:31:20 pm

very good questions ..

Tuesday 15 January 2013 12:31:29 am

Hi Keymaster, and welcome!

Besides the tutorials, to answer your questions directly:

1. Should you use eZ Publish for all your entities & 2. if both, how to tie them together

Short: yes, if your goal is to fully take advantage of eZ Publish
Long: It depends, you can certainly mix and match this by making sure you for instance keep content centric entities in eZ Publish and more pure app data in for instance Doctrine. Then someone can create a eZ Publish "FieldType" to tie them together. Even generic maybe, like a foreign relations FieldType cable of using just Symfony, doctrine and a bit of config to specify which entities to allow for ( this would be configured in the "content type field definition" ) each relation ( this would be stored in the "content field value" ).

3.Is there any relation between Doctrine and eZ Publish, are the repository concepts the same?

Totally different, eZ Publish provides its own much more abstracted content repository where you would typically use a gui to set up entities, but you can of course also use the api to be able to do it. The API you should be reading up on is the Public API, it handles permissions and validation before using the underlying persistence storage engine. And no, we currently don't use Doctrine at all, we might use Doctrine DBAL internally in the future, but that comes down to prioritizing refactoring what we already have on top of Zeta Components Database.

4. Do you have any example of a simple crud app

Good question, for the time being there are no such examples. Most of our examples (cookbook recipes) centres around content. And we need to get an overview of what kind of features we need to be able to become a truly integrated part of the app eco system in Symfony. For instance; dealing with relations and permissions across both eZ Publish and non eZ Publish aware bundles.

5. Is there any plan to leverage more of the Symfony cmf?

Not a specified plan pr say other than a wish to make sure we contribute to this project on parts we see fit for our needs. We have been discussing create.js and PHPCR(both as ezp persistence and making ezp a phpcr back-end) several times, but I can't promise anything on those at the moment.

6. Is it correct to say that if we built an app on top of ez5, with all our entities in the ez5 repo, they will benefit from all ezp's features?

Yes, all it's mistakes as well, but we're constantly working on those happy.gif Emoticon

7. How to integrate custom admin parts, or change login form when those are currently not in Symfony2?

Currently, as you mentioned, all gui's are in "legacy", and only way to extend those is to do it in legacy.
For pure Symfony2 gui's, those will start to appear over the course of this year. There will most likely be a AdminBundle, ContentEditorialBundle and a DemoBundle (or FrontEndBundle). We plan to make those GUI's extendable, but we certainly don't have a 100% overview on what the feature are needed in a Symfony2 context, as mentioned above. So this is where we could start to work a bit together, all as part of the community.

8. I read in the legacy ez4 documentation that there is no ACID properties in the repo. Can you please clarify?

Not sure which doc page this is, what it is documenting and what the context is. But even legacy uses transactions, and tries to avoid data corruption. Legacy database does not use foreign keys however, so if there is a bug in the code, there is a risk of miss aligned data until fixed with code and db fix. This is also planned to be solved late this year, with a vastly improved storage engine for 5.x kernel.

Modified on Tuesday 15 January 2013 12:32:03 am by André R

Tuesday 15 January 2013 8:37:52 am

Thanks very much for the answers, especially the clear and detailed response from Andre.

At this point the choices seem to be:

1. develop the app totally in ezp repository and benefit from the full power of ezp in all aspects of your app.

... but you'll have to work with the legacy code for the admin, front end editing gui, front end login and other forms, access control, and perhaps other areas too, etc. (until they get migrated to Symfony2)

2. keep the content related stuff in ezp and your custom app stuff in Doctrine.

... but then you need to figure out some way to relate the two, in two directions: from ezp to Doctrine, and from Doctrine to ezp; also, you'll need to figure out some way to apply ezp access control rules to your Doctrine ORM stuff.

Congratulations on the incredible progress you've all made in such a short time.

Looking forward with great interest to the continued integration of the venerable ezp with the rest of the Symfony2 app development ecosystem.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from