collection = $collection->create()->addFieldToSelect('*')->setOrder('title', Collection::SORT_ORDER_ASC); } public function toArray() { $array = []; foreach ($this->toOptionArray() as $item) { $array[$item['value']] = $item['label']; } return $array; } public function toOptionArray() { $options = []; foreach ($this->collection as $carousel) { $options[] = [ 'value' => $carousel->getIdentifier(), 'label' => $carousel->getTitle() ]; } return $options; } }