Which index mode is valid?
Answer : C
In Magento, the 'Update on save' index mode is valid. This mode automatically updates the index whenever the data is saved. The other options, 'Update on refresh' and 'Update on Invalidate,' do not exist in Magento.
A developer found a bug inside a private method of a third party module class. How can the developer override the method?
Answer : A
To override a private method of a third-party module class, we need to create our own custom class with correct logic (overridden method) having same name & signature of target method, creating Preference configuration through di.xml that references our new class instead of original one.
A developer needs to configure a page to use the single-column layout. Which XML code performs this task?
Answer : A
To configure a page to use the single-column layout, the developer should use the following XML code:
How should a developer display a custom attribute on the category edit page in the admin panel when a new module Vendor.Category is created?
Answer : B
To display a custom attribute on the category edit page in the admin panel, you need to create a view/adminhtml/ui_component/category_form.xml file in the module and define the field for the attribute in it.
Which file is used to add a custom router class to the list of routers?
Answer : B
In Magento's routing process configured area routers takes precedence over global router configurations defined in config.xml . So , One can add a custom router class definition inside routes.xml like this : ``` ='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='urn:magento:framework:App/etc/routes.xsd'> <router id='[ROUTER_ID]'> <route frontName='[FRONT_NAME]'> <module name='[MODULE_NAME]' before='[OTHER_ROUTE_OR_MODULE]'/> </route> </router> </config> ``` Reference : https://devdocs.magento.com/guides/v2.4/extension-dev-guide/routing.html#cusroute_def
Which tag should be used in module.xml to ensure dependency modules are loaded in the proper order?
Answer : A
In Magento's module.xml file, the <sequence></sequence> tag should be used to ensure that dependency modules are loaded in the proper order. This tag defines the load order of modules, making sure that dependent modules are loaded before the current module.
How should a developer associate a resource model inherited from the \Magento\Framework\Model\ResourceModel\Db\AbslractDb class with a corresponding table in the database?
Answer : B
To associate a resource model inherited from the \Magento\Framework\Model\ResourceModel\Db\AbstractDb class with a corresponding table in the database, the developer should pass the table name to the '_init' method. This method is called during the construction of the resource model and sets the table name for the model.