/** * Returns an instance of class. * * @return OCSAFFILIATES_BOL_VerificationDao */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
/** * @param string $code * @return bool */ public function processVerificationCode($code) { if (!mb_strlen($code)) { return false; } $verification = $this->verificationDao->findByCode($code); if (!$verification) { return false; } if ($verification->expireStamp < time()) { return false; } /** @var OCSAFFILIATES_BOL_Affiliate $affiliate */ $affiliate = $this->affiliateDao->findById($verification->affiliateId); if (!$affiliate) { return false; } $this->verificationDao->deleteById($verification->id); $affiliate->emailVerified = 1; $this->affiliateDao->save($affiliate); return true; }