How do you select a list of records from the database where the record ids are in the $ids list?

Assume that $collection is a new instance of a class that extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection, and $ids is an array of ids.

A. $collection->addFieldToFilter(‘record_id’,[‘in’=>$ids]);
B.
C. $collection->in($ids);
D. $collection->filterIn($ids);

Answer is A here.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x