<?php
namespace App\Utils\BaseParser\Structure\StructureParser\Types;

/**
 * Individual tax component
 * @author Lucian Sirbu
 */
class PriceComponent extends \Engine\Serializer\MagicMethods\CustomAbstract
{
	public $category = 	null;	// supplier, tax, commission, etc.
	public $source = 	null;	// remark, K, TFD, etc.
	public $amount = 	null;
	public $VAT = 		null;
	public $currency = 	null;
	public $code = 		null;

	public function __construct($category=null, $source=null, $amount=null, $VAT=null, $currency=null, $code='default')
	{
		$this->category = 	$category;
		$this->source = 	$source;
		$this->code = 		$code;

		$this->VAT = 		($VAT===null?null:$VAT);
		$this->amount = 	($amount===null?null:$amount);
		$this->currency = 	$currency;
	}

	/**
	 * Get a deep clone of this object
	 * @return \App\Utils\BaseParser\Structure\StructureParser\Types\PriceComponent
	 */
	public function getClone()
	{
		// return unserialize(serialize($this));	// this is overkill, clone() works well for shallow objects
		return clone($this);
	}

}
