protected function insertCampaignObject($id, $accountId, $name, $description, $dateIns, $status, $productid, $campaignId) {
        $obj = new Pap_Common_Campaign();
        $obj->setId($id);
        $obj->setAccountId($accountId);
        $obj->setName($name);
        $obj->set('description', $description);
        $obj->set('dateinserted', $dateIns);
        $obj->setCampaignStatus($status);

        $publicStatus = $this->getPap3Setting($campaignId, 'Aff_camp_status');

        $obj->setCampaignType(($publicStatus == 1 ? Pap_Db_Campaign::CAMPAIGN_TYPE_PUBLIC : Pap_Db_Campaign::CAMPAIGN_TYPE_ON_INVITATION));
        $obj->set('productid', $productid);
        $obj->resetOverwriteCookieToDefault();
        $obj->save();

        $commGrp = new Pap_Db_CommissionGroup();
        $commGrp->setId($obj->getDefaultCommissionGroup());
        $commGrp->load();
        $commGrp->delete();
    }
    protected function checkBeforeSave(Pap_Common_Campaign $row, Gpf_Rpc_Form $form, $operationType) {
        /**
         $this->checkCampaignValidity($row, $form, $operationType);
         */

        if($row->getIsDefault() && $row->get('rstatus') <> Pap_Db_Campaign::CAMPAIGN_STATUS_ACTIVE) {
            throw new Gpf_Exception($this->_("Error, you cannot deactivate Default campaign"));
        }

        if($row->get('rstatus') == "") {
            throw new Gpf_Exception($this->_("You have to specify status of campaign (rstatus field)"));
        }

        /*
         if ($row->getIsDefault() || $row->getCampaignType() == null) {
         if ($form->existsField('rtype') && $form->getFieldValue('rtype') != Pap_Db_Campaign::CAMPAIGN_TYPE_PUBLIC) {
         throw new Gpf_Exception($this->_("Type of default campaign must be public"));
         }
         }
         */
        if ($row->getDateInserted() == null || $row->getDateInserted() == '') {
            $row->setDateInserted(Gpf_Common_DateUtils::now());
        }
        if (!$form->existsField('accountid') || $form->getFieldValue('accountid') == '') {
            $row->set("accountid", Gpf_Session::getAuthUser()->getAccountId());
        }

        return true;
    }