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

use SabaiApps\Directories\Component\Entity\FieldType\ReferenceFieldType;
use SabaiApps\Directories\Component\Entity\Model\Bundle;

class PlanDiscountFieldType extends ReferenceFieldType {

	protected function _fieldTypeInfo() {
		return array(
			'label'            => __( 'Discount', 'directories-pro' ),
			'creatable'        => true,
			'disablable'       => false,
			'requirable'       => false,
			'schema_type'      => 'entity_reference',
			'default_settings' => array(
				'post_type' => 'post',
			),
			'admin_only'       => true,
		) + parent::_fieldTypeInfo();
	}

	public function fieldTypeInitialSettings( $name, Bundle $bundle, array $settings ) {
		$settings['bundle_type'] = 'paymentgateway_discount';
		return $settings;
	}
}
