Create a LDIF entry to rename a LDAP object (the RDN).

@param string $dn
@param string $name The new name.
@param bool $deleteOldRdn Whether or not the old RDN should be deleted.
@return LdifEntryModRdn
501012
public function rename($dn, $name, $deleteOldRdn = false)
    {
        return new LdifEntryModRdn($dn, null, $name, $deleteOldRdn);
    }
947702
public function deleteEntry($dn)
    {
        if (! (@ldap_delete($this->connection, $dn))) {
            $code = @ldap_errno($this->connection);
            throw new PersistenceException(
                sprintf(
                    'Could not delete entry %s: Ldap Error Code=%s - %s',
                    $dn,
                    $code,
                    ldap_err2str($code)
                )
            );
        }
    }
809604
public function create($dn, array $entries)
	{
		if (!$this->isBound || !$this->isConnected())
		{
			return false;
		}

		return ldap_add($this->resource, $dn, $entries);
	}
505716
public static function explodeDn($dn, $removeAttributePrefixes = true)
    {
        $dn = ldap_explode_dn($dn, ($removeAttributePrefixes ? 1 : 0));

        if (is_array($dn) && array_key_exists('count', $dn)) {
            foreach ($dn as $rdn => $value) {
                $dn[$rdn] = self::unescape($value);
            }
        }

        return $dn;
    }
495800
def rename(self, dn: str, new_rdn: str, new_base_dn: Optional[str] = None) -> None:
        

        return self._do_with_retry(
            lambda obj: obj.rename_s(dn, new_rdn, new_base_dn))
1257136
public function ldap_bind($ldap, $dn = NULL, $password = NULL)
	{
		return \ldap_bind($ldap, $dn, $password);
	}
666496
public function rename($groupName, $newName, $container)
    {
        $groupDn = $this->dn($groupName);

        if ($groupDn) {
            $newRDN = 'CN='.$newName;

            // Determine the container
            $container = array_reverse($container);
            $container = 'OU='.implode(', OU=', $container);

            $dn = $container.', '.$this->adldap->getBaseDn();

            return $this->connection->rename($groupDn, $newRDN, $dn, true);
        }

        return false;
    }
315462
def rename(dn, new_rdn, delete_old, *args)
      log_dispatch(:rename, dn, new_rdn, delete_old, *args)
      adapter.rename(dn, new_rdn.to_str, delete_old, *args)
    end
1299905
public Name add(int index, String string) throws InvalidNameException {
		try {
			names.add(index, new LdapRdn(string));
		}
		catch (BadLdapGrammarException e) {
			throw new InvalidNameException("Failed to parse rdn '" + string + "'");
		}
		return this;
	}
64590
public Entry lookup(String dn) throws LdapException {
        return this.service.getAdminSession().lookup(new Dn(dn));
    }
369434
public function deleteRole(
        RoleDeleteData $data,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: sprintf('delete-role-%d', $data->getRole()->id);

        return $this->formFactory->createNamed($name, RoleDeleteType::class, $data);
    }
218902
public function deletePolicy(
        PolicyDeleteData $data,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: sprintf('delete-policy-%s', md5(implode('/', $data->getPolicy())));

        return $this->formFactory->createNamed($name, PolicyDeleteType::class, $data);
    }
395760
protected function getCommonString($dn = null)
    {
        $dn = $dn ?: $this->dn;
        $ldif = $this->addCommentsToString('');
        $ldif .= $this->getLdifLine(Ldif::DIRECTIVE_DN, $dn);
        $ldif = $this->addControlsToString($ldif);
        $ldif .= $this->getLdifLine(Ldif::DIRECTIVE_CHANGETYPE, $this->changeType);

        return $ldif;
    }
1295634
public function addEntry($dn, $data)
    {
        $data = $this->normalizeData($data);

        if (! (@ldap_add($this->connection, $dn, $data))) {
            $code = @ldap_errno($this->connection);
            throw new PersistenceException(
                sprintf(
                    'Could not add entry %s: Ldap Error Code=%s - %s',
                    $dn,
                    $code,
                    ldap_err2str($code)
                )
            );
        }
    }
1323959
public function cleanDirectory($directoryName, $deleteRootDirectory = false)
    {
        if(is_dir($directoryName)){
            $files = glob( $directoryName . '/*', GLOB_NOSORT );

            foreach( $files as $file )
            {
                $this->cleanDirectory( $file, true );
            }

            if(file_exists($directoryName) && ($deleteRootDirectory == true)) {
                @rmdir( $directoryName );
            }
        } elseif(is_file($directoryName)) {
            @unlink( $directoryName );
        }

        if(file_exists($directoryName)) {
            return true;
        }

        return false;
    }
641402
public function modReplace($dn, array $entry)
    {
        if ($this->suppressErrors) {
            return @ldap_mod_replace($this->getConnection(), $dn, $entry);
        }

        return ldap_mod_replace($this->getConnection(), $dn, $entry);
    }
848474
public function deleteRoles(
        RolesDeleteData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: sprintf('delete-roles');

        return $this->formFactory->createNamed($name, RolesDeleteType::class, $data);
    }