<?php
/*
 *
 * @package		ARI Smart Content
 * @author		ARI Soft
 * @copyright	Copyright (c) 2011 www.ari-soft.com. All rights reserved
 * @license		GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
 * 
 */

(defined('_JEXEC') && defined('ARI_FRAMEWORK_LOADED')) or die;

AriKernel::import('Joomla.Models.Model');
AriKernel::import('Joomla.Database.DBUtils');

class AriSmartContentModelFormatter extends AriModel 
{
	function saveFormatter($data)
	{
		$formatter = $this->getTable();
		$formatter->bind($data);

		if (!$formatter->store())
		{
			JError::raiseError(
				500, 
				JText::sprintf(
					'COM_ARISMARTCONTENT_ERROR_SQL_QUERY', 
					__CLASS__ . '::' . __FUNCTION__ . '()', 
					$formatter->getQuery(), 
					$formatter->getError()
				)
			);
			return null;
		}
		
		return $formatter;
	}
}