collection = $collection; } public function getAllOptions() { $data = $this->collection->getData(); $options = [ [ 'label' => 'Select option!', 'value' => '', ] ]; foreach ($data as $record) { $options[] = [ 'label' => $record['id'], 'value' => $record['title'], ]; }; $this->_options = $options; return $options; } public function getOptionText($value) { foreach ($this->getAllOptions() as $option) { if ($option['value'] == $value) { return $option['label']; } } return false; } public function getFlatColumns() { $attributeCode = $this->getAttribute()->getAttributeCode(); return [ $attributeCode => [ 'unsigned' => false, 'default' => null, 'extra' => null, 'type' => Table::TYPE_INTEGER, 'nullable' => true, 'comment' => 'Kai Banner ' . $attributeCode . ' column', ], ]; } }