<?php
class Calendarista_WooCommerceSetting extends Calendarista_EntityBase
{
	public $id = 1000;
	public $enabled = true;
	public $paymentOperator = Calendarista_PaymentOperator::WOOCOMMERCE;
	public $title;
	public $orderIndex = 0;
	public $enableInlineForm = false;
	public $wooProductId;
	public function __construct($args)
	{
		$this->title = __('Secure payment during checkout', 'calendarista');
		if(array_key_exists('wooProductId', $args)){
			$this->wooProductId = (int)$args['wooProductId'];
		}
		if(array_key_exists('enabled', $args)){
			$this->enabled = (bool)$args['enabled'];
		}
		if(array_key_exists('title', $args)){
			$this->title = (string)$args['title'];
		}
		if(array_key_exists('orderIndex', $args)){
			$this->orderIndex = (int)$args['orderIndex'];
		}
		if(array_key_exists('id', $args)){
			$this->id = (int)$args['id'];
		}
	}
	public function toArray(){
		return array(
			'id'=>$this->id
			, 'enabled'=>$this->enabled
			, 'paymentOperator'=>$this->paymentOperator
			, 'title'=>$this->title
			, 'orderIndex'=>$this->orderIndex
			, 'enableInlineForm'=>$this->enableInlineForm
			, 'wooProductId'=>$this->wooProductId
		);
	}
}
?>