PHP Class LdapTools\Query\Operator\BaseOperator

Author: Chad Sikorra ([email protected])
Show file Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Property Type Description
$alias The alias this operator is associated with, if any.
$attribute The attribute name.
$convertedAliasValue The attribute value for specific aliases that were used.
$convertedValue The attribute name after any possible schema has been applied.
$converterAliasUsed Whether or not an attribute converter was used for a specific alias.
$converterUsed Whether or not an Attribute Converter was used.
$operatorSymbol The operator symbol (ie. &, |, =, <=, >=, etc)
$shouldUseConverter Whether or not a converter, if present, will be used against this operator.
$translatedAliasAttribute The attribute name for a specific alias after its schema has been applied.
$translatedAttribute The attribute name after any possible schema has been applied.
$validOperators The valid operator symbols that can be set.
$value The value for the attribute without any possible converters.

Public Methods

Method Description
getAlias ( ) : string | null Get the alias this operator is associated with. If none is assigned this will be null.
getAttribute ( ) : string | null Get the attribute.
getConvertedValue ( string | null $alias = null ) : mixed Get the converted value.
getLdapFilter ( null $alias = null ) : string
getOperatorSymbol ( ) : string Get the operator symbol in use.
getTranslatedAttribute ( string | null $alias = null ) : string | null Get the translated attribute (the attribute after the schema conversion).
getUseConverter ( ) : boolean Get whether a converter should be used or not.
getValue ( ) : mixed Get the attribute value.
getWasConverterUsed ( string | null $alias = null ) : boolean Get whether a converter was used or not.
setAlias ( $alias ) Set the alias this operator is associated with. To assign no alias set it to null.
setAttribute ( string $attribute ) Set the attribute.
setConvertedValue ( mixed $value, string | null $alias = null ) Set the converted value.
setOperatorSymbol ( $symbol ) Set the operator symbol in use.
setTranslatedAttribute ( $attribute, string | null $alias = null ) Set the translated attribute (the attribute after the schema conversion).
setUseConverter ( boolean $value ) Set whether a converter should be used or not.
setValue ( mixed $value ) Set the attribute value.
setWasConverterUsed ( boolean $value, string | null $alias = null ) Set whether a converter was used or not.
toLdapFilter ( string | null $alias = null ) : string Returns the operator translated to its LDAP filter string value.

Protected Methods

Method Description
getAttributeToQuery ( null | string $alias ) : string This will get the translated attribute or just the attribute if no schema translation was done.
getValueForQuery ( null | string $alias ) : mixed Depending on whether a converter was used, get the value that should be used for the query.
skipFilterForAlias ( string | null $alias ) : boolean Determine whether the operator should actually produce a filter (only if alias is null or matches the current one)

Method Details

getAlias() public method

Get the alias this operator is associated with. If none is assigned this will be null.
public getAlias ( ) : string | null
return string | null

getAttribute() public method

Get the attribute.
public getAttribute ( ) : string | null
return string | null

getAttributeToQuery() protected method

This will get the translated attribute or just the attribute if no schema translation was done.
protected getAttributeToQuery ( null | string $alias ) : string
$alias null | string
return string

getConvertedValue() public method

Get the converted value.
public getConvertedValue ( string | null $alias = null ) : mixed
$alias string | null
return mixed

getLdapFilter() public method

Deprecation: Use the 'toLdapFilter()' method instead.
public getLdapFilter ( null $alias = null ) : string
$alias null
return string

getOperatorSymbol() public method

Get the operator symbol in use.
public getOperatorSymbol ( ) : string
return string

getTranslatedAttribute() public method

Get the translated attribute (the attribute after the schema conversion).
public getTranslatedAttribute ( string | null $alias = null ) : string | null
$alias string | null
return string | null

getUseConverter() public method

Get whether a converter should be used or not.
public getUseConverter ( ) : boolean
return boolean

getValue() public method

Get the attribute value.
public getValue ( ) : mixed
return mixed

getValueForQuery() protected method

Depending on whether a converter was used, get the value that should be used for the query.
protected getValueForQuery ( null | string $alias ) : mixed
$alias null | string
return mixed

getWasConverterUsed() public method

Get whether a converter was used or not.
public getWasConverterUsed ( string | null $alias = null ) : boolean
$alias string | null
return boolean

setAlias() public method

Set the alias this operator is associated with. To assign no alias set it to null.
public setAlias ( $alias )

setAttribute() public method

Set the attribute.
public setAttribute ( string $attribute )
$attribute string

setConvertedValue() public method

Set the converted value.
public setConvertedValue ( mixed $value, string | null $alias = null )
$value mixed
$alias string | null

setOperatorSymbol() public method

Set the operator symbol in use.
public setOperatorSymbol ( $symbol )
$symbol

setTranslatedAttribute() public method

Set the translated attribute (the attribute after the schema conversion).
public setTranslatedAttribute ( $attribute, string | null $alias = null )
$alias string | null

setUseConverter() public method

Set whether a converter should be used or not.
public setUseConverter ( boolean $value )
$value boolean

setValue() public method

Set the attribute value.
public setValue ( mixed $value )
$value mixed

setWasConverterUsed() public method

Set whether a converter was used or not.
public setWasConverterUsed ( boolean $value, string | null $alias = null )
$value boolean
$alias string | null

skipFilterForAlias() protected method

Determine whether the operator should actually produce a filter (only if alias is null or matches the current one)
protected skipFilterForAlias ( string | null $alias ) : boolean
$alias string | null
return boolean

toLdapFilter() public method

Returns the operator translated to its LDAP filter string value.
public toLdapFilter ( string | null $alias = null ) : string
$alias string | null
return string

Property Details

$alias protected property

The alias this operator is associated with, if any.
protected $alias

$attribute protected property

The attribute name.
protected $attribute

$convertedAliasValue protected property

The attribute value for specific aliases that were used.
protected $convertedAliasValue

$convertedValue protected property

The attribute name after any possible schema has been applied.
protected $convertedValue

$converterAliasUsed protected property

Whether or not an attribute converter was used for a specific alias.
protected $converterAliasUsed

$converterUsed protected property

Whether or not an Attribute Converter was used.
protected $converterUsed

$operatorSymbol protected property

The operator symbol (ie. &, |, =, <=, >=, etc)
protected $operatorSymbol

$shouldUseConverter protected property

Whether or not a converter, if present, will be used against this operator.
protected $shouldUseConverter

$translatedAliasAttribute protected property

The attribute name for a specific alias after its schema has been applied.
protected $translatedAliasAttribute

$translatedAttribute protected property

The attribute name after any possible schema has been applied.
protected $translatedAttribute

$validOperators protected property

The valid operator symbols that can be set.
protected $validOperators

$value protected property

The value for the attribute without any possible converters.
protected $value