What is the best practice to save a module state on Magento 2.3.x?
-
06-04-2021 - |
Pergunta
I need to save/retrieve information gathered my module. The information might be anything big or small. There may be one or many variables to save and retrieve.
I have identified three ways to save a module state in Magento :
- Using Config (core_config_data).
- Using Variable (variables) also known as "Custom variables".
- Using own resources using a new table in the database.
Which one should I use to save a module state? Are there known best practice for this scenario?
Nenhuma solução correta
Outras dicas
If you need to store data temporarily between script executions or sessions, you might want to look at FlagManager. Data is stored in the flag
table.
Usages in core: https://github.com/magento/magento2/search?q=flagManager-%3EsaveFlag&unscoped_q=flagManager-%3EsaveFlag
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange