protected function onAfterRemove() { $this->repository = null; $this->persistedId = null; $this->modified = []; }