Model
Category
Magento\Catalog\Model\Config\Source\Category
What it does
This class provides a source model for category dropdown options in Magento's admin configuration forms.
It's used when you need to populate a select field with root-level categories, commonly seen in system configuration or admin forms where users need to choose a category.
The class loads category names and IDs, optionally including a 'Please Select' empty option.
Public Methods
- toOptionArray()