当前位置: 首页>>代码示例>>PHP>>正文


PHP Activity::CreateForContent方法代码示例

本文整理汇总了PHP中Activity::CreateForContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::CreateForContent方法的具体用法?PHP Activity::CreateForContent怎么用?PHP Activity::CreateForContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Activity的用法示例。


在下文中一共展示了Activity::CreateForContent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: afterSave

 public function afterSave()
 {
     parent::afterSave();
     if ($this->isNewRecord) {
         $activity = Activity::CreateForContent($this);
         $activity->type = "DocumentCreated";
         $activity->module = "documents";
         $activity->save();
         $activity->fire();
     }
     return true;
 }
开发者ID:nilBora,项目名称:MVC_documents_Yii,代码行数:12,代码来源:Document.php

示例2: afterSave

 /**
  * After Save Addons
  *
  * @return type
  */
 public function afterSave()
 {
     parent::afterSave();
     if ($this->isNewRecord) {
         $activity = Activity::CreateForContent($this);
         $activity->type = "QuestionCreated";
         $activity->module = "questionanswer";
         $activity->save();
         $activity->fire();
     }
     HSearch::getInstance()->addModel($this);
     return true;
 }
开发者ID:tejrajs,项目名称:humhub-modules-questionanswer,代码行数:18,代码来源:Question.php

示例3: afterSave

 /**
  * After Saving of comments, fire an activity
  *
  * @return type
  */
 protected function afterSave()
 {
     // flush the cache
     $this->flushCache();
     $activity = Activity::CreateForContent($this);
     $activity->type = "CommentCreated";
     $activity->module = "comment";
     $activity->save();
     $activity->fire();
     // Send Notifications
     NewCommentNotification::fire($this);
     AlsoCommentedNotification::fire($this);
     return parent::afterSave();
 }
开发者ID:ahdail,项目名称:humhub,代码行数:19,代码来源:Comment.php

示例4: afterSave

 /**
  * Before Save Addons
  *
  * @return type
  */
 public function afterSave()
 {
     parent::afterSave();
     if ($this->isNewRecord) {
         $activity = Activity::CreateForContent($this);
         $activity->type = "PostCreated";
         $activity->module = "post";
         $activity->save();
         $activity->fire();
     }
     // Handle mentioned users
     UserMentioning::parse($this, $this->message);
     return true;
 }
开发者ID:alefernie,项目名称:intranet,代码行数:19,代码来源:Post.php

示例5: afterSave

 /**
  * After Save, delete LikeCount (Cache) for target object
  */
 protected function afterSave()
 {
     Yii::app()->cache->delete('likes_' . $this->object_model . "_" . $this->object_id);
     $activity = Activity::CreateForContent($this);
     $activity->type = "Like";
     $activity->module = "like";
     // Object Id for likes are not the Like Object itself
     $activity->object_model = $this->object_model;
     $activity->object_id = $this->object_id;
     $activity->save();
     $activity->fire();
     // Send Notifications
     NewLikeNotification::fire($this);
     return parent::afterSave();
 }
开发者ID:skapl,项目名称:design,代码行数:18,代码来源:Like.php

示例6: afterSave

 /**
  * After Saving of comments, fire an activity
  *
  * @return type
  */
 protected function afterSave()
 {
     // flush the cache
     $this->flushCache();
     $activity = Activity::CreateForContent($this);
     $activity->type = "CommentCreated";
     $activity->module = "comment";
     $activity->save();
     $activity->fire();
     // Handle mentioned users
     // Execute before NewCommentNotification to avoid double notification when mentioned.
     UserMentioning::parse($this, $this->message);
     if ($this->isNewRecord) {
         // Send Notifications
         NewCommentNotification::fire($this);
     }
     return parent::afterSave();
 }
开发者ID:skapl,项目名称:design,代码行数:23,代码来源:Comment.php

示例7: afterSave

 /**
  * After Saving album fire the album created activity
  */
 public function afterSave()
 {
     parent::afterSave();
     if ($this->isNewRecord) {
         $activity = Activity::CreateForContent($this);
         $activity->type = "AlbumCreated";
         $activity->module = "album";
         $activity->save();
         $activity->fire();
         /**
          * Fire the Notification to user followers.
          */
         AlbumNotification::fire($this);
     }
 }
开发者ID:rafapaul,项目名称:humhub-modules-album,代码行数:18,代码来源:Album.php


注:本文中的Activity::CreateForContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。