Failed Conditions
Push — master ( e7b6d0...f491f4 )
by Denis
03:14
created

NotBetween::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types = 1);
2
3
namespace Artprima\QueryFilterBundle\Query\Condition;
4
5
use Artprima\QueryFilterBundle\Query\Filter;
6
use Doctrine\ORM\QueryBuilder;
7
8
/**
9
 * Class NotBetween
10
 *
11
 * @author Denis Voytyuk <[email protected]>
12
 *
13
 * @package Artprima\QueryFilterBundle\Query\Condition
14
 */
15
class NotBetween implements ConditionInterface
16
{
17 1
    public function getExpr(QueryBuilder $qb, int $index, Filter $filter)
18
    {
19 1
        $expr = $filter->getField() . ' NOT BETWEEN ' . ':x'.$index . ' AND ' . ':y'.$index;
20 1
        $qb->setParameter('x'.$index, $filter->getX() ?? '');
21 1
        $qb->setParameter('y'.$index, $filter->getY() ?? '');
22
23 1
        return $expr;
24
    }
25
}