Pop\Db\Sql\Predicate::notBetween PHP Метод

notBetween() публичный Метод

Predicate for NOT BETWEEN
public notBetween ( string $column, string $value1, string $value2, string $combine = 'AND' ) : Predicate
$column string
$value1 string
$value2 string
$combine string
Результат Predicate
    public function notBetween($column, $value1, $value2, $combine = 'AND')
    {
        $this->predicates[] = array('format' => '%1 NOT BETWEEN %2 AND %3', 'values' => array($column, $value1, $value2), 'combine' => $combine == 'OR' ? 'OR' : 'AND');
        return $this;
    }

Usage Example

Пример #1
0
 public function testNotBetween()
 {
     $p = new Predicate(Sql::factory(Db::factory('Sqlite', array('database' => __DIR__ . '/../tmp/test.sqlite')), 'users'));
     $p->notBetween('id', 5, 10);
     $this->assertEquals('("id" NOT BETWEEN 5 AND 10)', (string) $p);
 }