protected function newWhereBinding($field, $operator, $value = null, $type = 'and')
{
switch (strtolower($type)) {
case 'and':
return new Where($field, $operator, $value);
case 'or':
return new OrWhere($field, $operator, $value);
default:
throw new InvalidArgumentException("Invalid binding type: {$type}.");
}
}