<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

/*
  -------------------- Name conventions --------------------
  Function names (except methods):

  ff_DescriptionOfFunction


  Constant names:

  cc_DescriptionOfConstant


  Variable names:

  $ST_DescriptionOfVariable

  where S is a scope, T is a type.

  The following scopes should be used:
  g - global
  s - static
  l - local
  m - member of class
  p - parameter

  The following types should be used:
  s - scalar
  a - array
  r - resource
  o - object
  m - mixed

  -------------------- end Name conventions --------------------
*/





class SQLType
{

	/* -------------------- Members -------------------- */
	var $ms_Value; // value of column
	var $ms_Error; // error message
	/* -------------------- end Members -------------------- */





	/* -------------------- Constructor -------------------- */
	function SQLType( $ps_Value )	{

		if( is_a( $ps_Value,'SQLType' ) ) {
			$this->copyFrom( $ps_Value );
		} else {
			$this->SetValue( $ps_Value );
			$this->SetError( NULL );
		}
	}
	/* -------------------- end Constructor -------------------- */





	/* -------------------- Set../Get... -------------------- */
	function SetValue( $ps_Value )
	{
		$this->ms_Value = $ps_Value;
	}

	function GetValue()
	{
		return $this->ms_Value;
	}

	function SetError( $ps_Error )
	{
		$this->ms_Error = $ps_Error;
	}

	function GetError()
	{
		return $this->ms_Error;
	}
	/* -------------------- end Set../Get... -------------------- */





	/* -------------------- "abstract" methods -------------------- */
	function Validate()
	{
		echo ( "method Validate should return TRUE or FALSE!" );
	}

	function SQL()
	{
		echo ( "method SQL should return string!" );
	}
	/* -------------------- end "abstract" methods -------------------- */

	function &copyFrom( &$poSrc ){
		if( is_a( $poSrc, 'SQLType' ) ) {
			$this->SetValue( $poSrc->GetValue() );
			$this->SetError( $poSrc->GetError() );
		}
		return $this;
	}

	function &getClone(){
		return new SQLType( $this );
	}

}
?>
