1: <?php
2: namespace phpcassa\Index;
3:
4: use phpcassa\ColumnFamily;
5:
6: /**
7: * @package phpcassa\Index
8: */
9: class IndexExpression extends \cassandra\IndexExpression {
10:
11: /**
12: * Constructs an IndexExpression to be used in an IndexClause, which can
13: * be used with get_indexed_slices().
14: * @param mixed $column_name the name of the column this expression will apply to;
15: * this column may or may not be indexed
16: * @param mixed $value the value that will be compared to column values using op
17: * @param string $op the operator to apply to column values
18: * and the 'value' parameter. Valid options include "EQ", "LT", "LTE",
19: * "GT", and "GTE". Defaults to testing for equality.
20: */
21: public function __construct($column_name, $value, $op="EQ") {
22: parent::__construct();
23: $this->column_name = $column_name;
24: $this->value = $value;
25: if (is_int($op)) {
26: $this->op = $op;
27: } else {
28: $operators = $GLOBALS['\cassandra\E_IndexOperator'];
29: $this->op = $operators[$op];
30: }
31: }
32: }
33: