protected function setSetting($id, $value) { $setting = $this->getSetting($id); if ($setting instanceof Setting) { $setting->setValue($value); } else { $setting = new Setting(); $setting->setId($id); $setting->setValue($value); $setting->setSite($this->site); $this->getEntityManager()->persist($setting); } $this->getEntityManager()->flush(); }
/** * {@inheritDoc} */ public function setId($id) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setId', array($id)); return parent::setId($id); }