:::: MENU ::::

Magento Tutorial | Magento Blog | Learn Magento 2

Cookies Consent Popup

 If there is a repository and it does what you need well, always prefer the repository.Repositories are part of the *Service Contracts* (they are implementations of interfaces in `Api`), this means they are meant as a public interface to other modules.# Use Repositories for full loading`$model->load()` is not part of the service contract. I had a question on that particular topic, you might find the answers useful: https://magento.stackexchange.com/questions/111286/is-there-ever-a-reason-to-prefer-model-load-over-service-contracts# Use...
Try this code.**system.xml**    <field id="list_mode" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">       <label>List Mode</label>               <source_model>Vendor\Module\Model\Config\Source\ListMode</source_model>    </field>**Vendor\Module\Model\Config\Source\ListMode.php**  namespace Vendor\Module\Model\Config\Source;    class ListMode implements \Magento\Framework\Data\OptionSourceInterface ...