Esempio n. 1
0
 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;
 }
Esempio n. 3
0
    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`');
    }
Esempio n. 4
0
 function init()
 {
     $this->setTable(Gpf_Db_Table_Settings::getInstance());
     parent::init();
 }
Esempio n. 5
0
 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);
     }
 }