示例#1
0
 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 setSite(\Omeka\Entity\Site $site)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSite', array($site));
     return parent::setSite($site);
 }