質問

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 :

  1. Using Config (core_config_data).
  2. Using Variable (variables) also known as "Custom variables".
  3. 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?

正しい解決策はありません

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top