/** * Removes pair by key. * * @param string $key */ public function remove($key) { $pair = $this->repository->find($key); if ($pair !== null) { $this->repository->remove($pair->getId()); $this->manager->flush(); $this->manager->refresh(); } }
/** * Removes a setting. * * @param Setting $setting */ public function remove(Setting $setting) { $this->repo->remove($setting->getId()); $this->manager->flush(); $this->manager->refresh(); $this->eventDispatcher->dispatch('ongr_settings.setting_change', new SettingChangeEvent('delete')); }