Illuminate\Database\Query\Builder::whereNotBetween PHP Method

whereNotBetween() public method

Add a where not between statement to the query.
public whereNotBetween ( string $column, array $values, string $boolean = 'and' ) : Builder | static
$column string
$values array
$boolean string
return Builder | static
    public function whereNotBetween($column, array $values, $boolean = 'and')
    {
        return $this->whereBetween($column, $values, $boolean, true);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * like wheres function ,call by internal
  * @param array $conds
  * @return $this
  */
 protected function _wheres($conds)
 {
     foreach ($conds as $field => $opAndVal) {
         if (is_null($opAndVal)) {
             $opAndVal = [null];
         }
         $opAndVal = (array) $opAndVal;
         $op = strtolower(count($opAndVal) == 1 ? '=' : $opAndVal[0]);
         $val = last($opAndVal);
         $field = str_contains($field, '.') ? $field : $this->_table . '.' . $field;
         switch ($op) {
             case 'in':
                 if (count($val) == 1) {
                     $this->_operator->where($field, '=', $val[0]);
                 } else {
                     $this->_operator->whereIn($field, $val);
                 }
                 break;
             case 'notin':
                 if (count($val) == 1) {
                     $this->_operator->where($field, '<>', $val[0]);
                 } else {
                     $this->_operator->whereNotIn($field, $val);
                 }
                 break;
             case 'between':
                 $this->_operator->whereBetween($field, $val);
                 break;
             case 'notbetween':
                 $this->_operator->whereNotBetween($field, $val);
                 break;
             case 'null':
                 if ($val) {
                     $this->_operator->whereNull($field);
                 } else {
                     $this->_operator->whereNotNull($field);
                 }
                 break;
             case 'raw':
                 $this->_operator->whereRaw($val);
                 break;
             default:
                 $this->_operator->where($field, $op, $val);
         }
     }
     return $this;
 }
All Usage Examples Of Illuminate\Database\Query\Builder::whereNotBetween