/** * @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]]; }
/** * @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; }