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; } } }
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); }