In Magento 2 there is a table called flag
.
The table is created Magento\Setup\Model\Installer
.
What does this table do / hold?
1 Answer
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, 2018 at 13:21
-
1