QuestionQ22

VerifiedEAV/Database

Which two methods add sorting to collections that inherit from the \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection class?

Choose two
Explanation

setOrder() defines the collection’s ordering by field and direction. addOrder() is an alias for setOrder(), so both add ordering to the collection.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!