collectionFactory = $collectionFactory; } /** * @inheritdoc * * MEQP2 Warning: Protected method. Needed to override AbstractDb's _construct */ protected function _construct() { $this->_isPkAutoIncrement = false; $this->_init(static::TABLE, static::FIELD_ID); } /** * Retrieve a list of Customer Codes indexed by Customer ID * * @param int[] $customerIds * @return \Vertex\Tax\Model\Data\CustomerCode[] */ public function getArrayByCustomerIds($customerIds) { /** @var Collection $collection */ $collection = $this->collectionFactory->create(); $collection->addFieldToFilter(static::FIELD_ID, ['in' => $customerIds]); $collection->load(); $result = []; foreach ($collection->getItems() as $item) { /** @var \Vertex\Tax\Model\Data\CustomerCode $item */ $result[$item->getCustomerId()] = $item; } return $result; } }