Log in
Model

Variable

Magento\Variable\Model\Variable

What it does

This model represents custom variables in Magento 2 that can be used throughout the system for dynamic content.

Developers use this class to create, load, validate, and retrieve custom variables by code, which can store both plain text and HTML values that are typically used in CMS content, email templates, and transactional emails.

Public Methods

  • setStoreId()
  • getStoreId()
  • loadByCode()
  • getValue()
  • beforeSave()
  • validate()
  • getVariablesOptionArray()