resource = $resource; } /** * @return array */ public function toOptionArray() { $options = []; $connection = $this->resource->getConnection(); $tableName = $this->resource->getTableName(self::CUSTOMFORM_TABLE); if ($connection->isTableExists($tableName)) { $select = $connection->select() ->from($tableName) ->reset(Select::COLUMNS) ->columns(['value' => 'form_id', 'label' => 'title']); $options = $connection->fetchAll($select); } return $options; } }