flatfile
[ class tree: flatfile ] [ index: flatfile ] [ all elements ]

Class: SimpleWhereClause

Source Location: /flatfile.php

Class Overview

WhereClause
   |
   --SimpleWhereClause

Implements a single WHERE clause that does simple comparisons of a field with a value.


Methods


Inherited Methods

Class: WhereClause

WhereClause::testRow()
Tests a table row object

Class Details

[line 459]
Implements a single WHERE clause that does simple comparisons of a field with a value.



[ Top ]


Class Methods


constructor SimpleWhereClause [line 497]

SimpleWhereClause SimpleWhereClause( int $field, string $operator, mixed $value, [string $compare_type = DEFAULT_COMPARISON])

Creates a new WhereClause object that does a comparison of a field and a value.

This will be the most commonly used type of WHERE clause. It can do comparisons of the sort "$tablerow[$field] operator $value" where 'operator' is one of:

  • = (equals)
  • != (not equals)
  • > (greater than)
  • < (less than)
  • >= (greater than or equal to)
  • <= (less than or equal to)
There are 3 pre-defined constants (STRING_COMPARISON, NUMERIC COMPARISON and INTEGER_COMPARISON) that modify the behaviour of these operators to do the comparison as strings, floats and integers respectively. Howevers, these constants are just the names of functions that do the comparison (the first being the builtin function strcmp(), so you can supply your own function here to customise the behaviour of this class.




Parameters:

int   $field   The index (in the table row) of the field to test
string   $operator   The comparison operator, one of "=", "!=", "<", ">", "<=", ">="
mixed   $value   The value to compare to.
string   $compare_type   The comparison method to use - either STRING_COMPARISON (default), NUMERIC COMPARISON or INTEGER_COMPARISON

[ Top ]

method testRow [line 505]

void testRow( $tablerow, [ $rowSchema = null])



Overrides WhereClause::testRow() (Tests a table row object)

Parameters:

   $tablerow  
   $rowSchema  

[ Top ]


Documentation generated on Sun, 25 Oct 2009 22:30:47 +0000 by phpDocumentor 1.4.3