Adldap\Query\Builder::newWhereBinding PHP Method

newWhereBinding() protected method

Constructs a new where binding depending on the specified type.
protected newWhereBinding ( string $field, string $operator, string | null $value = null, string $type = 'and' ) : Where | Adldap\Query\Bindings\OrWhere
$field string
$operator string
$value string | null
$type string
return Adldap\Query\Bindings\Where | Adldap\Query\Bindings\OrWhere
    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}.");
        }
    }