Answer the question
In order to leave comments, you need to log in
How to make symfony2 friends with a ready-made product database?
Hello!
I am learning symphony.
There is a database of products, which is divided into tables:
- products
- stores
- brands
- categories (nesting is built on the basis of parent_id, so far I haven’t come up with anything better)
The task is to have access to the catalog from the admin panel, the ability to manage products - put tags , tags like "promotion" and the like, that is, expand the directory. And then the output on the site according to the category table + pagination.
As I understand it, you can write a solution yourself (admin panel + showcase), but maybe there is a ready-made bundle? Or is it better to write your own to fit your needs and not waste time finishing off ready-made solutions?
And how can you better create a table of product categories? Because I feel there will be problems with recursion.
Thank you!
Answer the question
In order to leave comments, you need to log in
Symphony itself does not know anything about your database, Doctrine does this.
I connected a ready-made bundle a la, configured a couple of lines and it worked for sure not for such a case.
In your case, there are two options:
1) Work directly with the DBAL layer (vanilla-SQL)
2) Convert the existing schema with data into doctrine entities with relations, and so on.
About categories: mikehillyer.com/articles/managing-hierarchical-dat...
Well, you can start with the fact that the console command:
will generate doctrine entities based on your base. If you have innodb and links are configured, it will even put them down. A bit to finish with the handles will remain and that's it.
For the admin panel, you can take the sonataAdminBundle. On it, in a maximum of a couple of hours, you rivet the admin panel to the resulting entities.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question