public function rewriteIds($idMapping)
{
$type = (string) $this->type;
if ($type && array_key_exists($this->type, $idMapping) and array_key_exists($this->getId(), $idMapping[$this->type])) {
$this->setId($idMapping[$this->type][$this->getId()]);
$this->setO(null);
}
}