How best to organize the structure of the object category, which has large text?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
I ask not to kick strongly for noob question. The question is not specific to Symfony, but work with her and Doctrine.

I need to make a category on the site - in fact this menu of the site consisting of 50-60 points. From a text - on the average text size is about 6kb. Menu present on all pages (well, usually on the websites), but the text only displays the current category, not all at once. It turns out that the other categories will just consume resources of the server, and virtual hosting they are not limitless.

I'm not an experienced programmer, therefore I ask Council. How best to organize object categories:
- write in category, just the text field?
or to put that text in a separate object and inject it in the category?

Perhaps due to the use of the doctrine in Symfony consumption of resources will be greater if the native PDO, and still better to use a nested object with text? Asking this because Symfony is the ability to use "lazy loading". And if I understand correctly, when using it, and the categories implemented by the objects that are downloaded will not all 60 categories, and only the one will treatment that will reduce the consumption of resources.

In General, prompt, as is usually done? The fact that I wanted to make tags that will definitely be implemented by the objects in the category (described above) and other objects (e.g., articles, images). Tags also need to add text for SEO optimization, which will be displayed on the page only if the active (selected) a specified tag. And it turns out that the category will be your text, and the text of all tags that are assigned to the category. In this case, the tags and text to introduce a separate object?

Thanks for the help!
by | 47 views

1 Answer

0 like 0 dislike
There is no need of carrying out any of the text or other information (preview, metadata, and other things). all the information pertaining to one category must be together in the same row of the database. if these data were not related to a specific category, not as a group or any other, then you can think about structuring, but if the data is unique, then to break them is not worth it. As for queries, you functionally need to post - just output categories, possibly with a preview, the output of the category on a separate page with a description, or other content;
Of course it's a different dB queries and not an exhaustive list, main. Let me remind you again that the categories themselves have a tree view (usually so). Therefore, the parents do not forget a better implementation where the thread to see. something like this.

Related questions

0 like 0 dislike
5 answers
0 like 0 dislike
2 answers
asked May 21, 2019 by polyanin
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
36,635 users