<?php
	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'class.api.php');

	class API_GLOSSARY extends API
	{
		var $glossaryid = 0;
		var $word = '';
		var $description = '';

		var $fields = array (
			'glossaryid',
			'word',
			'description',
		);

		var $pk = 'glossaryid';

		/**
		* Constructor
		* We have to override the default constructor here since the table name
		* doesn't follow the default rule
		*
		* @return false
		*/
		function API_GLOSSARY()
		{
			parent::API();
			$this->table = $GLOBALS['tablePrefix'].'glossary';
		}

		/**
		* validate_word
		*
		* Check if the word is empty
		*
		* @param string $var
		*
		* @return bool
		*/
		function validate_word($var)
		{
			return !empty($var);
		}

		/**
		* validate_description
		*
		* Check if the description is empty
		*
		* @param string $var
		*
		* @return bool
		*/
		function validate_description($var)
		{
			return !empty($var);
		}
	}

?>
