Detailed Description
Criteria defines a condition on a PersistentObject's attribute used to select specific instances.
Definition at line 21 of file Criteria.php.
Public Member Functions | |
__construct ($type, $attribute, $operator, $value, $combineOperator=Criteria::OPERATOR_AND) | |
setType ($type) | |
getType () | |
setAttribute ($attribute) | |
getAttribute () | |
setOperator ($operator) | |
getOperator () | |
setValue ($value) | |
getValue () | |
setCombineOperator ($combineOperator) | |
getCombineOperator () | |
getId () | |
__toString () | |
Static Public Member Functions | |
static | asValue ($operator, $value) |
Public Attributes | |
const | OPERATOR_AND = 'AND' |
const | OPERATOR_OR = 'OR' |
Protected Attributes | |
$type = null | |
$attribute = null | |
$operator=null | |
$value = null | |
$combineOperator = Criteria::OPERATOR_AND | |
Constructor & Destructor Documentation
◆ __construct()
__construct | ( | $type, | |
$attribute, | |||
$operator, | |||
$value, | |||
$combineOperator = Criteria::OPERATOR_AND |
|||
) |
Constructor.
- Parameters
-
$type The PersistentObject type that has the attribute $attribute The name of the attribute $operator The comparison operator used to compare the given value with the attribute's value $value The value to compare the object with $combineOperator The Criteria::OPERATOR to use, when this criteria is combined with other criteria (optional, default: Criteria::OPERATOR_AND)
Definition at line 42 of file Criteria.php.
Member Function Documentation
◆ asValue()
|
static |
Factory method for constructing a Criteria that may be used as value on a PersistentObject's attribute (no type, attribute parameter needed)
- Parameters
-
$operator The comparison operator used to compare the given value with the attribute's value $value The value to compare the object with
- Returns
- Criteria
Definition at line 58 of file Criteria.php.
◆ setType()
setType | ( | $type | ) |
Set the PersistentObject type that has the attribute.
- Parameters
-
$type The type name
Definition at line 66 of file Criteria.php.
◆ getType()
getType | ( | ) |
Get the PersistentObject type that has the attribute.
- Returns
- String
Definition at line 74 of file Criteria.php.
◆ setAttribute()
setAttribute | ( | $attribute | ) |
Set the name of the attribute.
- Parameters
-
$attribute The attribute name
Definition at line 82 of file Criteria.php.
◆ getAttribute()
getAttribute | ( | ) |
◆ setOperator()
setOperator | ( | $operator | ) |
Set the comparison operator used to compare the given value with the attribute's value.
- Parameters
-
$operator The operator
Definition at line 99 of file Criteria.php.
◆ getOperator()
getOperator | ( | ) |
Get the comparison operator used to compare the given value with the attribute's value.
- Returns
- String
Definition at line 108 of file Criteria.php.
◆ setValue()
setValue | ( | $value | ) |
Set the value to compare the object with.
- Parameters
-
$value The value
Definition at line 116 of file Criteria.php.
◆ getValue()
getValue | ( | ) |
◆ setCombineOperator()
setCombineOperator | ( | $combineOperator | ) |
Set the Criteria::OPERATOR to use, when this criteria is combined with other criteria.
- Parameters
-
$combineOperator One of the Criteria::OPERATOR constants
Definition at line 132 of file Criteria.php.
◆ getCombineOperator()
getCombineOperator | ( | ) |
Get the Criteria::OPERATOR to use, when this criteria is combined with other criteria.
- Returns
- One of the Criteria::OPERATOR constants
Definition at line 140 of file Criteria.php.
◆ getId()
getId | ( | ) |
◆ __toString()
__toString | ( | ) |
Get a string representation of the criteria.
- Returns
- String
Definition at line 158 of file Criteria.php.
Member Data Documentation
◆ OPERATOR_AND
const OPERATOR_AND = 'AND' |
Definition at line 23 of file Criteria.php.
◆ OPERATOR_OR
const OPERATOR_OR = 'OR' |
Definition at line 24 of file Criteria.php.
◆ $type
|
protected |
Definition at line 26 of file Criteria.php.
◆ $attribute
|
protected |
Definition at line 27 of file Criteria.php.
◆ $operator=null
|
protected |
Definition at line 28 of file Criteria.php.
◆ $value
|
protected |
Definition at line 29 of file Criteria.php.
◆ $combineOperator
|
protected |
Definition at line 30 of file Criteria.php.