_customerGroupCollectionFactory = $customerGroupCollectionFactory; } public function toOptionArray() { $customerGroups = $this->_customerGroupCollectionFactory->create(); $customerGroupArray = []; foreach ($customerGroups as $customerGroup) { $customerGroupArray[] = [ 'value' => $customerGroup->getCode(), 'label' => $customerGroup->getCode() ]; } return $customerGroupArray; } }