eZ\Publish\Core\Persistence\Doctrine\DoctrineExpression::between PHP Method

between() public method

The parameter $expression is checked if it is between $value1 and $value2. Note: There is a slight difference in the way BETWEEN works on some databases. http://www.w3schools.com/sql/sql_between.asp. If you want complete database independence you should avoid using between(). Example: $q = $dbHandler->createSelectQuery(); $q->select( '*' )->from( 'table' ) ->where( $q->expr->between( 'id', $q->bindValue( 1 ), $q->bindValue( 5 ) ) );
public between ( string $expression, string $value1, string $value2 ) : string
$expression string the value to compare to
$value1 string the lower value to compare with
$value2 string the higher value to compare with
return string logical expression
    public function between($expression, $value1, $value2)
    {
        return "{$expression} BETWEEN {$value1} AND {$value2}";
    }