<?php

class Brivium_Credits_DataWriter_ConversationMessage extends XFCP_Brivium_Credits_DataWriter_ConversationMessage
{
	protected function _postSave()
	{
		if ($this->isInsert())
		{
			$dataCredit = array(
				'content_id' 	=>	$this->get('conversation_id'),
				'content_type'	=>	'conversation',
			);
			if(!$this->getOption(self::OPTION_UPDATE_CONVERSATION)){
				$this->getModelFromCache('Brivium_Credits_Model_Credit')->updateUserCredit('createConversation',$this->get('user_id'),$dataCredit);
			}else{
				$GLOBALS['BRC_DW_replyConversation'] = $this->get('user_id');
			}
		}
		return parent::_postSave();
	}
}