PHP Class LdapTools\Resolver\ParameterResolver

Author: Chad Sikorra ([email protected])
ファイルを表示 Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Property Type Description
$attributes All of the attributes to iterate through.
$parameters Any explicitly set parameters.
$requirements Contains the attribute name with an array of parameters it requires.
$resolvedParameters Parameters that have been resolved to their final values.

Public Methods

Method Description
__construct ( array $attributes, array $parameters )
hasParameters ( array | string $value ) : boolean Check whether the value has any parameters in it.
resolve ( ) : array Gets the attributes with all of the parameters resolved.

Protected Methods

Method Description
checkForCircularDependency ( string $parent, array $parentParameters ) Given an attribute with parameter dependencies, check if any of them will become circular.
doResolveParametersForAttribute ( string $attribute, array $parameters ) Sets the value for an attribute with the specified parameters.
evaluateRequirements ( array $attributes ) Check all attributes for what parameters they require. This populates the '$this->requirements' array. It will then iterate back over the requirements to check for issues.
getDependentAttributes ( array $parameters ) : array Checks for required parameter attributes that depend on other parameter attributes. Returns an array of of dependencies.
getParametersInValue ( string | array $value ) : array Given an attribute value get all parameters it expects.
getValueForParameters ( array $parameters, array | string $original, array $attributes ) : string Takes all parameters (%username%, %someParameter%) within an attribute value and first checks for explicitly set values for the parameter, then checks to see if the parameter name is a different attribute. If found it takes the value either explicitly set or of the other attribute and replaces it within the original attribute.
resolveAllParameters ( ) Iterates over each requirement to resolve the parameters it contains.
resolveParametersForAttribute ( $attribute, array $parameters ) Given a specific attribute with parameters, this will resolve it while first resolving any dependent attributes that first need to be resolved.
setRequirementsForAttribute ( string $attribute, array $value ) Given an attribute, set what parameters it requires.

Method Details

__construct() public method

public __construct ( array $attributes, array $parameters )
$attributes array
$parameters array

checkForCircularDependency() protected method

Given an attribute with parameter dependencies, check if any of them will become circular.
protected checkForCircularDependency ( string $parent, array $parentParameters )
$parent string
$parentParameters array

doResolveParametersForAttribute() protected method

Sets the value for an attribute with the specified parameters.
protected doResolveParametersForAttribute ( string $attribute, array $parameters )
$attribute string
$parameters array

evaluateRequirements() protected method

Check all attributes for what parameters they require. This populates the '$this->requirements' array. It will then iterate back over the requirements to check for issues.
protected evaluateRequirements ( array $attributes )
$attributes array

getDependentAttributes() protected method

Checks for required parameter attributes that depend on other parameter attributes. Returns an array of of dependencies.
protected getDependentAttributes ( array $parameters ) : array
$parameters array
return array

getParametersInValue() protected static method

Given an attribute value get all parameters it expects.
protected static getParametersInValue ( string | array $value ) : array
$value string | array
return array

getValueForParameters() protected method

Takes all parameters (%username%, %someParameter%) within an attribute value and first checks for explicitly set values for the parameter, then checks to see if the parameter name is a different attribute. If found it takes the value either explicitly set or of the other attribute and replaces it within the original attribute.
protected getValueForParameters ( array $parameters, array | string $original, array $attributes ) : string
$parameters array All of the parameters found within the value.
$original array | string The original value for the attribute, containing the parameters.
$attributes array All of the attributes being sent to LDAP.
return string The attribute value after the passed parameters have been set.

hasParameters() public static method

Check whether the value has any parameters in it.
public static hasParameters ( array | string $value ) : boolean
$value array | string
return boolean

resolve() public method

Gets the attributes with all of the parameters resolved.
public resolve ( ) : array
return array

resolveAllParameters() protected method

Iterates over each requirement to resolve the parameters it contains.
protected resolveAllParameters ( )

resolveParametersForAttribute() protected method

Given a specific attribute with parameters, this will resolve it while first resolving any dependent attributes that first need to be resolved.
protected resolveParametersForAttribute ( $attribute, array $parameters )
$attribute
$parameters array

setRequirementsForAttribute() protected method

Given an attribute, set what parameters it requires.
protected setRequirementsForAttribute ( string $attribute, array $value )
$attribute string
$value array

Property Details

$attributes protected_oe property

All of the attributes to iterate through.
protected $attributes

$parameters protected_oe property

Any explicitly set parameters.
protected $parameters

$requirements protected_oe property

Contains the attribute name with an array of parameters it requires.
protected $requirements

$resolvedParameters protected_oe property

Parameters that have been resolved to their final values.
protected $resolvedParameters