protected function clear() {
    foreach ($this->newObjects as $object) {
      unset($this->observedObjects[$object->getOID()->__toString()]);
    }
    $this->newObjects = [];

    foreach ($this->dirtyObjects as $object) {
      unset($this->observedObjects[$object->getOID()->__toString()]);
    }
    $this->dirtyObjects = [];

    foreach ($this->deletedObjects as $object) {
      unset($this->observedObjects[$object->getOID()->__toString()]);
    }
    $this->deletedObjects = [];

    foreach ($this->loadedObjects as $object) {
      unset($this->observedObjects[$object->getOID()->__toString()]);
    }
    $this->loadedObjects = [];

    $this->detachedObjects = [];
  }