public function toOperation()
{
// If this is a move operation to a new OU and we have a DN already, then we can figure out the RDN.
if (is_null($this->newRdn) && !is_null($this->newSuperior)) {
$rdn = LdapUtilities::getRdnFromDn($this->dn);
} else {
$rdn = $this->newRdn;
}
return new RenameOperation($this->dn, $rdn, $this->newSuperior, $this->deleteOldRdn);
}