public function add($for, $for_id, $user_id, $action, $data = '')
	{
		$history = new $this->model;
		$history->for = $for;
		$history->for_id = $for_id;
		$history->user_id = $user_id;
		$history->action = $action;
		$history->data = is_array($data) ? json_encode($data) : $data;

		$history->save();

		return $history;
	}
public function add($for, $for_id, $user_id, $action, $data = '')
	{
		$history = new $this->model;
		$history->for = $for;
		$history->for_id = $for_id;
		$history->user_id = $user_id;
		$history->action = $action;
		$history->data = is_array($data) ? json_encode($data) : $data;

		$history->save();

		return $history;
	}
public function add ( $ for , $ for_id , $ user_id , $ action , $ data = '' ) { $ history = new $ this -> model ; $ history -> for = $ for ; $ history -> for_id = $ for_id ; $ history -> user_id = $ user_id ; $ history -> action = $ action ; $ history -> data = is_array ( $ data ) ? json_encode ( $ data ) : $ data ; $ history -> save ( ) ; return $ history ; }
Adds a new history record
@param string $for
@param integer $for_id
@param integer $user_id
@param $action
@param mixed $data
@return mixed
Adds a new history record