/**
* Moves the current model to a new RDN and new parent.
*
* @param string $rdn
* @param string|null $newParentDn
* @param bool|true $deleteOldRdn
*
* @return bool
*/
public function move($rdn, $newParentDn = null, $deleteOldRdn = true)
{
$moved = $this->query->getConnection()->rename($this->getDn(), $rdn, $newParentDn, $deleteOldRdn);
if ($moved) {
// If the model was successfully moved, we'll set its
// new DN so we can sync it's attributes properly.
$this->setDn("{$rdn},{$newParentDn}");
$this->syncRaw();
return true;
}
return false;
}