nerdexam
Magento

M70-101 · Question #83

You want to filter a product collection so that it will return only SKUs 12 and 123. You will use a call to $collection->addFieldToFilter ('sku', ____________ ); Two of the following arrays could be…

The correct answer is B. array (array ('eq' => 12), array ('eq' => 123) ) D. array (12, 123). See the full explanation below for the reasoning.

Question

You want to filter a product collection so that it will return only SKUs 12 and 123. You will use a call to $collection->addFieldToFilter ('sku', ____________ ); Two of the following arrays could be used to complete that call correctly. Which two? (Choose two)

Options

  • Aarray ('sku' => 12, 'sku' => 123)
  • Barray (array ('eq' => 12), array ('eq' => 123) )
  • Carray (12 => true, 123 => true)'
  • Darray (12, 123)
  • Earray (array ('int' => 12), array ('int' => 123) )

How the community answered

(54 responses)
  • A
    4% (2)
  • B
    81% (44)
  • C
    4% (2)
  • E
    11% (6)

Community Discussion

No community discussion yet for this question.

Full M70-101 Practice