11

In Magento 2 there is a table called flag.
The table is created Magento\Setup\Model\Installer.
What does this table do / hold?

14

Magento components uses this table as key-values storage for any data, if creation additional table is overhead. But many developers doesn't know about this functionality and uses config or special custom tables for such data.

You can find all usages of this table using search among childs of \Magento\Framework\Flag class.

Moreover, this functionality available beginning from Magento 1.

For example:

Your module creates additional attribute set in InstallData, but you need to store attribute set id for usage in future.

  • So basically, If I need one value stored for something I can store it here? For example to know the last time a script was executed. – Marius Jan 31 '18 at 13:21
  • @Marius yes. Look at github.com/magento/magento2/blob/… for example – Max Jan 31 '18 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.