<?php

class ProductGroup extends Eloquent {

	protected $softDelete	 = true;
	protected $guarded		 = array();
	public static $rules	 = array();

	public function productType() {
		return $this->belongsTo('ProductType');
	}

	public function saveProductGroupQuantHistory($productId = null, $productGroupId = null, $productTypeId = null, $addedQuant = null, $oldQuant = null, $addedQuantBlocked = null, $oldQuantBlocked = null, $message) {
	  StorageRefrence::create(array(
								'product_id'			    => $productId,
								'product_group_id'    => $productGroupId,
								'product_type_id'	    => $productTypeId,
								'added_quant'	        => $addedQuant,
								'old_quant'	          => $oldQuant,
				        'added_quant_blocked' => $addedQuantBlocked,
								'old_quant_blocked'	  => $oldQuantBlocked,
								'comment'	            => $message,
								'sender_user_id'	    => Sentry::getUser()->id
		));
	}
}
