LdapTools\Hydrator\ArrayHydrator::hydrateToLdap PHP Method

hydrateToLdap() public method

public hydrateToLdap ( $attributes )
    public function hydrateToLdap($attributes)
    {
        if (!is_array($attributes)) {
            throw new InvalidArgumentException('Expects an array to convert data to LDAP.');
        }
        $attributes = $this->mergeDefaultAttributes($attributes);
        $this->validateAttributesToLdap($attributes);
        $attributes = $this->resolveParameters($attributes);
        $attributes = $this->convertValuesToLdap($attributes);
        $attributes = $this->convertNamesToLdap($attributes);
        return $attributes;
    }

Usage Example

 /**
  * @param AddOperation $operation
  */
 protected function hydrateAddOperation(AddOperation $operation)
 {
     $this->setDefaultParameters();
     $operation->setAttributes(parent::hydrateToLdap($operation->getAttributes()));
     $this->setDnToUse($operation);
     $operation->setAttributes($this->filterAttributeValues($operation->getAttributes()));
 }