當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Website::triggerAll方法代碼示例

本文整理匯總了PHP中Website::triggerAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Website::triggerAll方法的具體用法?PHP Website::triggerAll怎麽用?PHP Website::triggerAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Website的用法示例。


在下文中一共展示了Website::triggerAll方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: trigger

 public function trigger($nickname = null)
 {
     $user = $this->load_user($nickname);
     Website::triggerAll($user);
     Site::Flash('notice', 'Update has been triggered');
     Redirect("admin/users/" . $user->permalink());
 }
開發者ID:ItsHaden,項目名稱:epicLanBootstrap,代碼行數:7,代碼來源:user.controller.php

示例2: save

 public function save()
 {
     if ($this->validate()) {
         $changed = false;
         if ($this->is_new) {
             $this->password = $this->hashPassword($this->password);
             $this->password_confirmation = $this->password;
             $this->activation_code = md5(time() . $this->nickname . $this->email . rand(10000, 99999));
             $this->cookie = md5(time() . $this->nickname . $this->email . $this->activation_code . rand(10000, 99999));
             $this->version = 1;
             $changed = true;
         } else {
             if ($this->changed_password) {
                 $this->password = $this->hashPassword($this->password);
                 $this->password_confirmation = $this->password;
             }
             if (!$this->cookie) {
                 $this->cookie = md5(time() . $this->nickname . $this->email . $this->activation_code . rand(10000, 99999));
             }
             // Update version
             if ($this->calculateHash() != $this->hash) {
                 $this->version++;
                 $changed = true;
             }
         }
         if ($this->activated && !$this->affiliate_code) {
             $this->affiliate_code = uniqid();
         }
         $result = parent::save(self::table);
         if ($result) {
             if ($changed) {
                 Website::triggerAll($this);
             }
             $this->sync_forums();
             if ($this->activated and $this->allow_emails) {
                 $this->newzapp_signup();
             }
             $id = mysql_real_escape_string($this->id);
             $user_profile = UserProfile::find("user_profiles.user_id = '{$id}'");
             if (!$user_profile) {
                 // Create a profile for the user
                 $user_profile = new UserProfile();
                 $user_profile->user_id = $this->id;
                 $user_profile->save();
             }
         }
         return $result;
     } else {
         return false;
     }
 }
開發者ID:ItsHaden,項目名稱:epicLanBootstrap,代碼行數:51,代碼來源:user.model.php


注:本文中的Website::triggerAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。