Example #1
0
 /**
  * Get the database connection
  *
  * @return  object
  */
 private static function getDbh()
 {
     if (!self::$dbh) {
         self::$dbh = App::get('db');
     }
     return self::$dbh;
 }
Example #2
0
 /**
  * Opt out of a promotion
  *
  * @return  void
  */
 public function incremOptOutTask()
 {
     if (!User::get('id')) {
         return;
     }
     require_once dirname(dirname(__DIR__)) . '/tables/incremental/awards.php';
     require_once dirname(dirname(__DIR__)) . '/tables/incremental/groups.php';
     require_once dirname(dirname(__DIR__)) . '/tables/incremental/options.php';
     $ia = new \ModIncrementalRegistrationAwards($profile);
     $ia->optOut();
     App::redirect(Route::url(User::link() . '&active=profile'), Lang::txt('You have been successfully opted out of this promotion.'), 'passed');
 }