SourceForge.net LogoPHPGallue
[ class tree: libbase ] [ index: libbase ] [ all elements ]

Class: GALExpressionCompare

Source Location: /libbase/table.inc.php

Class Overview

GALExpression
   |
   --GALExpressionCompare

Creates SQL comparison strings.


Methods


Inherited Methods

Class: GALExpression

GALExpression::eand()
Connect two or more statements with AND.
GALExpression::enot()
Invert this logical expression.
GALExpression::eor()
Connect two or more statements with OR.
GALExpression::__toString()
String representation of this logical expression.

Class Details

[line 33]
Creates SQL comparison strings.

This class generates SQL snippets that compare fields with constant values. Supportet comparison operators are "=", "!=", ">", ">=", "<" and "<=". It is introduced to help avoiding common mistakes like misspelled field names, quoting errors or SQL injection through unfiltered user input.




[ Top ]


Class Methods


constructor __construct [line 64]

GALExpressionCompare __construct( GALDatabase $database, mixed $table, string $field, string $operator, string $value)

Construct with database information, field, operator and value.

The table can be given as string, in this case a GALTable object is constructed from this string by calling GALDatabase::table().




Tags:

access:  public


Parameters:

GALDatabase   $database   A database connection.
mixed   $table   The referenced table, either GALTable or string.
string   $field   The name of the compared field.
string   $operator   One of "=", "!=", ">", ">=", "<" or "<=".
string   $value   The value the field is compared with.

[ Top ]

method __toString [line 105]

string __toString( )

SQL string representation of the comparison expression.



Tags:

return:  "(`$table`.`$field` $operator '$value')"
access:  public


Overrides GALExpression::__toString() (String representation of this logical expression.)

[ Top ]


Documentation generated on Wed, 16 Aug 2006 15:36:45 +0200 by phpDocumentor 1.3.0RC6