Example #1
0
 /**
  * @return array
  */
 public function getSettings()
 {
     $settings = $this->getYamlParameters();
     $currency = new Setting();
     $currency->setKey('currency')->setValue($settings['currency'])->setType('select2')->setOptions(Intl::getCurrencyBundle()->getCurrencyNames($settings['locale']));
     $emailSettings = $this->getEmailSettings($settings);
     return ['system' => ['general' => ['currency' => $currency]], 'email' => ['sending_options' => $emailSettings]];
 }
Example #2
0
 /**
  * @return array
  */
 public function getSettings()
 {
     if (!$this->checkConnection()) {
         return array();
     }
     $settings = array('notification' => array());
     /** @var \CSBill\SettingsBundle\Repository\SettingsRepository $repository */
     $repository = $this->manager->getRepository('CSBillNotificationBundle:Notification');
     $values = $repository->findAll();
     foreach ($values as $value) {
         /* @var \CSBill\NotificationBundle\Entity\Notification $value */
         $setting = new Setting();
         $setting->setKey($value->getEvent())->setValue(array('email' => $value->getEmail(), 'hipchat' => $value->getHipchat(), 'sms' => $value->getSms()))->setType('notification');
         $settings['notification'][$value->getEvent()] = $setting;
     }
     return $settings;
 }
Example #3
0
 /**
  * Add a setting.
  *
  * @param Setting $setting
  *
  * @return Section
  */
 public function addSetting(Setting $setting)
 {
     $this->settings[] = $setting;
     $setting->setSection($this);
     return $this;
 }