PHP Class Adldap\Query\Grammar

Show file Open project: adldap2/adldap2 Class Usage Examples

Public Methods

Method Description
compileAnd ( string $query ) : string Wraps the inserted query inside an AND operator.
compileApproximatelyEquals ( string $field, string $value ) : string Returns a query string for approximately equals.
compileContains ( string $field, string $value ) : string Returns a query string for contains.
compileDoesNotEqual ( string $field, string $value ) : string Returns a query string for does not equal.
compileEndsWith ( string $field, string $value ) : string Returns a query string for ends with.
compileEquals ( string $field, string $value ) : string Returns a query string for equals.
compileGreaterThanOrEquals ( string $field, string $value ) : string Returns a query string for greater than or equals.
compileHas ( string $field ) : string Returns a query string for a where has.
compileLessThanOrEquals ( string $field, string $value ) : string Returns a query string for less than or equals.
compileNotContains ( string $field, string $value ) : string Returns a query string for does not contain.
compileNotEndsWith ( string $field, string $value ) : string Returns a query string for does not end with.
compileNotHas ( string $field ) : string Returns a query string for a where does not have.
compileNotStartsWith ( string $field, string $value ) : string Returns a query string for does not start with.
compileOr ( string $query ) : string Wraps the inserted query inside an OR operator.
compileQuery ( Builder $builder ) : string Compiles the Builder instance into an LDAP query string.
compileStartsWith ( string $field, string $value ) : string Returns a query string for starts with.
wrap ( string $query, string $prefix = '(', string $suffix = ')' ) : string Wraps a query string in brackets.

Protected Methods

Method Description
compileOrWheres ( array $orWheres, string $query = '' ) : string Assembles all or where clauses in the current orWheres property.
compileWhere ( Where $where ) : string | null Assembles a single where query based on its operator and returns it.
compileWheres ( array $wheres, string $query = '' ) : string Assembles all where clauses in the current wheres property.

Method Details

compileAnd() public method

Produces: (&query)
public compileAnd ( string $query ) : string
$query string
return string

compileApproximatelyEquals() public method

Produces: (field~=value)
public compileApproximatelyEquals ( string $field, string $value ) : string
$field string
$value string
return string

compileContains() public method

Produces: (field=*value*)
public compileContains ( string $field, string $value ) : string
$field string
$value string
return string

compileDoesNotEqual() public method

Produces: (!(field=value))
public compileDoesNotEqual ( string $field, string $value ) : string
$field string
$value string
return string

compileEndsWith() public method

Produces: (field=*value)
public compileEndsWith ( string $field, string $value ) : string
$field string
$value string
return string

compileEquals() public method

Produces: (field=value)
public compileEquals ( string $field, string $value ) : string
$field string
$value string
return string

compileGreaterThanOrEquals() public method

Produces: (field>=value)
public compileGreaterThanOrEquals ( string $field, string $value ) : string
$field string
$value string
return string

compileHas() public method

Produces: (field=*)
public compileHas ( string $field ) : string
$field string
return string

compileLessThanOrEquals() public method

Produces: (field<=value)
public compileLessThanOrEquals ( string $field, string $value ) : string
$field string
$value string
return string

compileNotContains() public method

Produces: (!(field=*value*))
public compileNotContains ( string $field, string $value ) : string
$field string
$value string
return string

compileNotEndsWith() public method

Produces: (!(field=value*))
public compileNotEndsWith ( string $field, string $value ) : string
$field string
$value string
return string

compileNotHas() public method

Produces: (!(field=*))
public compileNotHas ( string $field ) : string
$field string
return string

compileNotStartsWith() public method

Produces: (!(field=*value))
public compileNotStartsWith ( string $field, string $value ) : string
$field string
$value string
return string

compileOr() public method

Produces: (|query)
public compileOr ( string $query ) : string
$query string
return string

compileOrWheres() protected method

Assembles all or where clauses in the current orWheres property.
protected compileOrWheres ( array $orWheres, string $query = '' ) : string
$orWheres array
$query string
return string

compileQuery() public method

Compiles the Builder instance into an LDAP query string.
public compileQuery ( Builder $builder ) : string
$builder Builder
return string

compileStartsWith() public method

Produces: (field=value*)
public compileStartsWith ( string $field, string $value ) : string
$field string
$value string
return string

compileWhere() protected method

Assembles a single where query based on its operator and returns it.
protected compileWhere ( Where $where ) : string | null
$where Adldap\Query\Bindings\Where
return string | null

compileWheres() protected method

Assembles all where clauses in the current wheres property.
protected compileWheres ( array $wheres, string $query = '' ) : string
$wheres array
$query string
return string

wrap() public method

Produces: (query)
public wrap ( string $query, string $prefix = '(', string $suffix = ')' ) : string
$query string
$prefix string
$suffix string
return string