<?php
/**
 * @version		$Id: history.php 115 2009-06-17 07:20:36Z eddieajau $
 * @copyright	Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
 * @license		GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
 * @link		http://www.theartofjoomla.com
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.database.table');

/**
 * History table class
 *
 * @package		TAOJ.Quanta
 * @subpackage	com_quanta
 */
class QuantaTableHistory extends JTable
{
	/**
	 * @var int unsigned
	 */
	var $id = null;
	/**
	 * @var int
	 */
	var $record_id = null;
	/**
	 * @var double
	 */
	var $record_value = null;
	/**
	 * @var timestamp
	 */
	var $record_time = null;
	/**
	 * @var int
	 */
	var $published = null;
	/**
	 * @var int
	 */
	var $user_id = null;

	/**
	 * @param database A database connector object
	 */
	function __construct(&$db)
	{
		parent::__construct('#__taoj_quanta_history', 'id', $db);
	}

	/**
	 * Check the internal properties of the table class.
	 *
	 * @return	boolean
	 */
	function check()
	{
		// check for valid name
		if (empty($this->record_id)) {
			$this->setError(JText::_('Quanta_Error_History_no_record'));
			return false;
		}
		if (empty($this->record_time)) {
			$this->setError(JText::_('Quanta_Error_History_no_time'));
			return false;
		}
		return true;
	}
}