While reviewing a layout file named sales_order_view.xml you notice the element
<update handle="customer_account"/>
What is the purpose of this element?
A. Replaces the customer_account handle with sales_order_view
B. Nothing, this element has been deprecated
C. Adds the customer_account handle to the page's handles list
D. Updates the current page handle to customer_account
正解:C
解説: (Pass4Test メンバーにのみ表示されます)
質問 2:
A module MyModule needs to send notifications to customers only when the account was modified from a mobile app using the REST web APIs.
You decided to implement an observer for customer_save_after_data_object event.
In which file do you declare the observer?
A. etc/events.xml
B. etc/webapi_rest/events.xml
C. etc/adminhtml/events.xml
D. etc/webapi/rest_events.xml
正解:B
質問 3:
How can you access the select query of a collection?
A. You can only access the select query after the collection has been loaded by calling the public method query()
B. You can get it by using public method getSelect() which returns an instance of Magento\Framework\DB\Select
C. It is stored in a protected variable $query and can only be accessed from the inside of a collection class
D. The select query is not available in the collection class, it will be generated by the MySQL adapter right before executing a query
正解:B
質問 4:
A merchant gives you the module MyCompany_MyModule to install.
How do you identify which REST endpoints are supported by the module?
A. Every public method of every interface in the Api folder automatically is exposed as a REST endpoint
B. REST endpoints are declared in etc/rest.xml
C. REST endpoints are declared in etc/webapi_rest/di.xml
D. REST endpoints are declared in etc/webapi.xml
正解:D
解説: (Pass4Test メンバーにのみ表示されます)
質問 5:
You need to find all orders in the processing state. You have written the code:
How do you resolve the exception?
A. Use dependency injection to load an instance of the SearchCriteria class
B. Clear generated code to get a new version of SearchCriteriaBuilder
C. Specify a preference in di.xml to map SearchCriteriaBuilder to SearchCriteriaInterface
D. Change the getList parameter to: $searchCriteraBuilder->addFilter('state','processing')->create()
正解:D
質問 6:
During a code review of a module MyCompany_PaymentCurrencies you see a configuration field declared in the file etc/adminhtml/system.xml:
What is the consequence of the attribute showInStore being set to 0?
A. The field value will not be accessible on the store front by calling ScopeConfigInterface::getValue() with a $scopeType argument of 'store'.
B. The input field will not be visible if a store view scope is selected in the system configuration
C. The input field will be disabled if a store view scope is selected in the system configuration
D. The input field will only be visible if a website's default store scope is selected in the system configuration
正解:B
質問 7:
You have created a module controller that responds to the following URL: /mycompany/product/load/id/123.
Which two methods will load the product model by ID as specified in the URL? (Choose two.)
A. \Magento\Catalog\Model\ResourceModel\Product::load($productModel, $id)
B. \Magento\Catalog\Model\ResourceModel\Product\Collection::fetchItemById($id)
C. \Magento\Catalog\Model\ResourceModel\Product\Collection::load()->fetchById($id)
D. \Magento\Catalog\Api\ProductRepositoryInterface::getById($id)
正解:C,D
質問 8:
\Magento\Sales\Model\Api\OrderRepositoryInterface::getList accepts a SearchCriteriaInterface to filter and sort information.
What class assists in creating an instance for SearchCriteriaInterface?
A. \Magento\Framework\Api\SearchCriteriaFactory
B. \Magento\Backend\Api\SearchCriteriaGenerator
C. \Magento\Framework\Api\SearchCriteriaBuilder
D. \Magento\Sales\Model\Order\SearchCriteria
正解:C
Oba -
Magento-2-Associate-Developerの問題集、理解しやすかったです。口コミどおり、これ問題集一つで合格できるって本当ですね。