Legacy_Criteria Class Reference

List of all members.

Public Member Functions

 add ($column, $value=null, $comparison=LEGACY_EXPRESSION_EQ)
 addAnd ($column, $value=null, $comparison=LEGACY_EXPRESSION_EQ)
 addOr ($column, $value=null, $comparison=LEGACY_EXPRESSION_EQ)
createCriterion ()
 _checkColumn ($column)
 _castingConversion ($column, &$value)

Public Attributes

 $mChildlen = array()

Detailed Description

This class is expression of criterion for handlers and useful for dynamic SQL. This class group doesn't have CriteriaCompo. There is add() member function to append conditions. For expression of nest, cast Legacy_Criteria instance into the member function. In this case, developers should get the instance by createCriteria() because Legacy_Criteria has to have Type Information for Type Safety. createCriteria() returns $criteria that has the same information.

This class have to be separated from any specific resource. It's possible to use for handlers of web service.

[Example 1] A = 1 AND B < 2 (SQL) $criteria->add('A', 1); $criteria->add('B', 2, '<');

[Example 2] A = 1 OR (B > 1 AND B < 5) (SQL) $criteria->add('A', 1); $subCriteria = $criteria->createCriteria(); $subCriteria->add('B', 1, '>'); $subCriteria->add('B', 5, '<'); $criteria->addOr($subCriteria);

[Warning] This class don't receive $criteria as reference.

[Note] We planned modifying old Criteria of XOOPS2 for Legacy generations. But, old Criteria class has some fatal problems for this plan unfortunately. Plus, it's manner violation that old class are patched to fundamental defect if it come to have two different class characteristics. Therefore we should make new Criteria that is like old Criteria. (Perhaps, old Criteria was created as Torque like)


Member Function Documentation

Legacy_Criteria::add ( column,
value = null,
comparison = LEGACY_EXPRESSION_EQ 
)

This is alias for addAnd().

Legacy_Criteria::addAnd ( column,
value = null,
comparison = LEGACY_EXPRESSION_EQ 
)

Add $criteria to childlen with AND condition.

Legacy_Criteria::addOr ( column,
value = null,
comparison = LEGACY_EXPRESSION_EQ 
)

Add $criteria to childlen with OR condition.

& Legacy_Criteria::createCriterion (  ) 

Create the instance of this class which has the same type information, and return it.

Returns:
object Legacy_Criterion

Legacy_Criteria::_checkColumn ( column  ) 

Check whether specified column exists in the list.

protected

Returns:
bool

Legacy_Criteria::_castingConversion ( column,
&$  value 
)

Do casting conversion. If type information is wrong, return false.

protected

Parameters:
$column string A name of column
$value reference of value.
Returns:
bool


Member Data Documentation

Legacy_Criteria::$mChildlen = array()

Childlen of this criteria.


The documentation for this class was generated from the following file:
Generated on Thu Nov 2 00:27:11 2006 for XOOPS Cube Legacy by  doxygen 1.5.1