src/LdapTools/Object/LdapObjectManager.php
protected function refreshDnIfNeeded(LdapOperationInterface $operation, LdapObject $ldapObject)
    {
        foreach ($operation->getPreOperations() as $childOp) {
            $this->refreshDnIfNeeded($childOp, $ldapObject);
        }

        if ($operation instanceof RenameOperation) {
            $ldapObject->refresh(['dn' => $this->getNewDnFromOperation($operation, $ldapObject)]);
        }

        foreach ($operation->getPostOperations() as $childOp) {
            $this->refreshDnIfNeeded($childOp, $ldapObject);
        }
    }
protected function refreshDnIfNeeded(LdapOperationInterface $operation, LdapObject $ldapObject)
    {
        foreach ($operation->getPreOperations() as $childOp) {
            $this->refreshDnIfNeeded($childOp, $ldapObject);
        }

        if ($operation instanceof RenameOperation) {
            $ldapObject->refresh(['dn' => $this->getNewDnFromOperation($operation, $ldapObject)]);
        }

        foreach ($operation->getPostOperations() as $childOp) {
            $this->refreshDnIfNeeded($childOp, $ldapObject);
        }
    }
protected function refreshDnIfNeeded ( LdapOperationInterface $ operation , LdapObject $ ldapObject ) { foreach ( $ operation -> getPreOperations ( ) as $ childOp ) { $ this -> refreshDnIfNeeded ( $ childOp , $ ldapObject ) ; } if ( $ operation instanceof RenameOperation ) { $ ldapObject -> refresh ( [ 'dn' => $ this -> getNewDnFromOperation ( $ operation , $ ldapObject ) ] ) ; } foreach ( $ operation -> getPostOperations ( ) as $ childOp ) { $ this -> refreshDnIfNeeded ( $ childOp , $ ldapObject ) ; } }
Based on the operation type, refresh the DN if needed. The order is important here. Older 'pre' operations are
refreshed first, then the operation itself, and finally any 'post' operations.

@param LdapOperationInterface $operation
@param LdapObject $ldapObject
Based on the operation type refresh the DN if needed . The order is important here . Older pre operations are refreshed first then the operation itself and finally any post operations .