orWhereNull() public method

Add an "or where null" clause to the query.
public orWhereNull ( string $column ) : Builder | static
$column string
return Builder | static
Example #1
0
 /**
  * Add an "or where null" clause to the query.
  *
  * @param string $column
  * @return \Illuminate\Database\Query\Builder|static 
  * @static 
  */
 public static function orWhereNull($column)
 {
     return \Illuminate\Database\Query\Builder::orWhereNull($column);
 }
 /**
  * Compile a "where in" clause.
  *
  * @param  \Illuminate\Database\Query\Builder  $query
  * @param  array  $where
  * @return string
  */
 protected function whereIn(Builder $query, $where)
 {
     if (empty($where['values'])) {
         return '0 = 1';
     }
     $suffix = "::BIGINT";
     foreach ($where['values'] as $column => $value) {
         if (is_null($value)) {
             $query->orWhereNull($column);
             continue;
         }
         if (!is_numeric($value)) {
             $suffix = "::TEXT";
             break;
         }
     }
     // Not using parameterize because syntax is any(values (), ())
     $values = implode("{$suffix}),(", array_map([$this, 'parameter'], $where['values']));
     if (count($where['values']) > 1) {
         return $this->wrap($where['column']) . " = any (values (" . $values . "{$suffix}))";
     } else {
         if (count($where['values']) === 1) {
             return $this->wrap($where['column']) . " = " . $values;
         }
     }
     return "1 = 1";
 }