<?php
namespace SabaiApps\Directories\Component\PaymentGateway\CSVExporter;

use SabaiApps\Directories\Component\CSV\Exporter\AbstractExporter;
use SabaiApps\Directories\Component\Entity\Model\Field;

class PlanCSVExporter extends AbstractExporter {

	public function csvExporterColumns( Field $field ) {
		return array(
			'plan_type'     => __( 'Plan type', 'directories-pro' ),
			'active'        => __( 'Active', 'directories-pro' ),
			'featured'      => __( 'Featured', 'directories-pro' ),
			'display_order' => __( 'Display order', 'directories-pro' ),
			'content_name'  => __( 'Content type', 'directories-pro' ),
			'data'          => __( 'Extra data', 'directories-pro' ),
		);
	}

	public function csvExporterDoExport( Field $field, array $settings, $value, array $columns, array &$formStorage, array &$logs ) {
		$ret         = parent::csvExporterDoExport( $field, $settings, $value, $columns, $formStorage, $logs );
		$ret['data'] = serialize( $ret['data'] );
		return $ret;
	}
}
