ExamGecko
Question list
Search
Search

Question 35 - AD0-E717 discussion

Report
Export

Which two methods add sorting to collections inherited from the \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection class? (Choose two.)

A.
setOrder
Answers
A.
setOrder
B.
setSorting
Answers
B.
setSorting
C.
addSorting
Answers
C.
addSorting
D.
addOrder
Answers
D.
addOrder
Suggested answer: A, D

Explanation:

The two methods that add sorting to collections inherited from the \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection class are setOrder and addOrder. These methods allow adding one or more order clauses to a collection query.

The setSorting and addSorting methods do not exist in Adobe Commerce.

Verified

Reference: [Adobe Commerce Developer Guide - Collections]

asked 02/10/2024
Lambert Shel Pablo
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first