php - Symfony 2 - Sonata create website menu based on multiple entities -


i have project written on symfony 2 uses sonata admin panel. need add sonata kind of menu management.

there 3 entities - page, category, poll. each entity has multiple instances. menu should able manage instances , write database.

so @ first thought create menu entity, hold instances, like:

+----+-----------+----------+---------+ | id |   name    |   type   | item_id | +----+-----------+----------+---------+ |  1 | page1     | page     |       3 | |  2 | category3 | category |       4 | |  3 | poll4     | poll     |       2 | |  4 | page3     | page     |       10| +----+-----------+----------+---------+ 

and connect somehow these entities menu entity.

in case menu entity hold 1 instance - mainmenu have page1, category3, poll4, page3 menu items.

but since not working symfony , sonata every day have no idea how approach schema.

maybe wrong , should organize way, love hear suggestions!!!


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -