Class BetweenColumnCondition represents a BETWEEN
condition where values is between two columns. For example:
new BetweenColumnsCondition(42, 'BETWEEN', 'min_value', 'max_value')
And a more complex example:
new BetweenColumnsCondition(
new Expression('NOW()'),
'NOT BETWEEN',
(new Query)->select('time')->from('log')->orderBy('id ASC')->limit(1),
'update_time'
);
Method Details
Creates a condition with the BETWEEN
operator.
public function __construct($value, $operator, $intervalStartColumn, $intervalEndColumn)
{
$this->value = $value;
$this->operator = $operator;
$this->intervalStartColumn = $intervalStartColumn;
$this->intervalEndColumn = $intervalEndColumn;
}
Creates object by array-definition as described in Query Builder – Operator format guide article.
public static function fromArrayDefinition($operator, $operands)
{
if (!isset($operands[0], $operands[1], $operands[2])) {
throw new InvalidArgumentException("Operator '$operator' requires three operands.");
}
return new static($operands[0], $operator, $operands[1], $operands[2]);
}
public function getIntervalEndColumn()
{
return $this->intervalEndColumn;
}
public function getIntervalStartColumn()
{
return $this->intervalStartColumn;
}
public function getOperator()
{
return $this->operator;
}
public function getValue()
{
return $this->value;
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4