M
M
magary42017-08-16 09:50:42
PHP
magary4, 2017-08-16 09:50:42

Data categorization. How to do it wisely?

now there is a table in the downloads database, it has a type column
, let's say file|image|mp3
on the page where it is displayed there is a filter, when selected, this column is filtered
Now the task has changed and you need to add an
image
-png
-jpg
-gif type nesting,
so I thought to take it out into a separate table types and store all the information there,
but before doing it, I decided to ask
, I know that almost all CMS use taxonomy for this,
can I also use this approach for my task? or how?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Sokolov, 2017-08-16
@sergiks

Guided by the KISS principle , maybe just start writing through the “ category.type ” separator:
Is this field in your table of the ENUM type?

M
Maxim Timofeev, 2017-08-16
@webinar

As I understand it, you can simply do a like request for ".jpg" for example. And according to the mind, the table should be:
id | filename | file_type
where file_type will already have numbers that will mean "mp3","jpeg",'gif' and everything else

U
usr58, 2017-08-25
@usr58

https://github.com/akeneo/pim-community-dev/blob/m...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question