LdapTools\Hydrator\OperationHydrator::hydrateToLdap PHP Method

hydrateToLdap() public method

public hydrateToLdap ( $operation, $dn = null )
    public function hydrateToLdap($operation, $dn = null)
    {
        $this->operation = $operation;
        if (!$operation instanceof LdapOperationInterface) {
            throw new InvalidArgumentException('Expects an instance of LdapOperationInterface to convert to LDAP.');
        }
        if (!$this->schema && !$operation instanceof QueryOperation) {
            return $operation;
        }
        return $this->hydrateOperation($operation);
    }

Usage Example

示例#1
0
 /**
  * Get the add operation and take care of the hydration process.
  *
  * @return AddOperation
  */
 protected function getAddOperation()
 {
     $operation = new AddOperation($this->dn, $this->attributes);
     $operation->setLocation($this->container);
     foreach ($this->parameters as $parameter => $value) {
         $this->hydrator->setParameter($parameter, $value);
     }
     $this->hydrator->setLdapObjectSchema($this->schema);
     $this->hydrator->setLdapConnection($this->connection);
     $this->hydrator->setOperationType(AttributeConverterInterface::TYPE_CREATE);
     return $this->hydrator->hydrateToLdap($operation);
 }
All Usage Examples Of LdapTools\Hydrator\OperationHydrator::hydrateToLdap