Example #1
0
 private function getNewNumberRefid() {
     $codeGenerator = new Gpf_Common_CodeUtils_CodeGenerator('{99999999}');
     for ($i = 1; $i <= 5; $i++) {
         $refid = $codeGenerator->generate();
         try {
             Pap_Affiliates_User::loadFromId($refid);
         } catch (Gpf_Exception $e) {
             return $refid;
         }
     }
 }
Example #2
0
    private function getNewRefid() {
        $codeGenerator = new Gpf_Common_CodeUtils_CodeGenerator(Gpf_Settings::get(CustomRefid_Config::CUSTOM_REFID_FORMAT));
        for ($i = 1; $i <= 5; $i++) {
            $refid = $codeGenerator->generate();
            try {
                Pap_Affiliates_User::loadFromId($refid);
            } catch (Gpf_Exception $e) {
                return $refid;
            }
        }
	}
 protected function insertCoupon(Pap_Db_Coupon $coupon) {
     $coupon->setCode($this->generator->generate());
     parent::insertCoupon($coupon);
 }