当前位置: 首页>>代码示例>>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;未经允许,请勿转载。