public static function getInstance() { if (self::$instance === null) { self::$instance = new self(); } return self::$instance; }
private function getSettingsFromDB() { $selectBuilder = new Gpf_SqlBuilder_SelectBuilder(); $selectBuilder->select->add(Gpf_Db_Table_Settings::NAME, Gpf_Db_Table_Settings::NAME); $selectBuilder->select->add(Gpf_Db_Table_Settings::VALUE, Gpf_Db_Table_Settings::VALUE); $selectBuilder->from->add(Gpf_Db_Table_Settings::getName()); return $selectBuilder; }
public function execute() { $this->createDatabase()->execute('ALTER TABLE `qu_pap_campaigns` ADD `longdescription` TEXT NULL'); $select = new Gpf_SqlBuilder_SelectBuilder(); $select->select->addAll(Gpf_Db_Table_Settings::getInstance()); $select->from->add(Gpf_Db_Table_Settings::getName()); $select->where->add(Gpf_Db_Table_Settings::NAME, '=', 'default_campaign_id'); try { $result = $select->getOneRow(); $previousDefaultCampaign = $result->get(Gpf_Db_Table_Settings::VALUE); $campaignForm = new Pap_Merchants_Campaign_CampaignForm(); $campaignForm->setCampaignDefault($previousDefaultCampaign); } catch (Gpf_DbEngine_NoRowException $e) { } $this->createDatabase()->execute('ALTER TABLE `qu_pap_campaigns` DROP `longdescription`'); }
function init() { $this->setTable(Gpf_Db_Table_Settings::getInstance()); parent::init(); }
protected function loadDbSetting($name) { try { $this->cache[$name] = Gpf_Db_Table_Settings::getSetting($name, $this->accountId); } catch (Gpf_Settings_UnknownSettingException $e) { $this->cache[$name] = $this->defines->getDefaultValue($name); } }