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


PHP Activity::add方法代码示例

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


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

示例1: test_clicking_user_name_in_activity_leads_to_profile_page

 public function test_clicking_user_name_in_activity_leads_to_profile_page()
 {
     $newUser = $this->getEditor();
     $this->actingAs($newUser);
     $entities = $this->createEntityChainBelongingToUser($newUser, $newUser);
     Activity::add($entities['book'], 'book_update', $entities['book']->id);
     Activity::add($entities['page'], 'page_create', $entities['book']->id);
     $this->asAdmin()->visit('/')->clickInElement('#recent-activity', $newUser->name)->seePageIs('/user/' . $newUser->id)->see($newUser->name);
 }
开发者ID:nwalke,项目名称:BookStack,代码行数:9,代码来源:UserProfileTest.php

示例2: setActivity

 /**
  * Instance an activity object and updated the time stamp or 
  * if the flag="new" insert a new entry (only for new record)
  */
 function setActivity($flag = "")
 {
     if (!empty($this->idcontact)) {
         $do_activity = new Activity();
         $do_activity->idcontact = $this->idcontact;
         if ($flag == "new") {
             $do_activity->add();
         } else {
             $do_activity->update();
         }
         $q = new sqlQuery($GLOBALS['conx']);
         $q->query("UPDATE " . $this->getSqlViewName() . " SET last_activity=now() WHERE idcontact=" . $this->idcontact);
         $q->free();
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:19,代码来源:.Contact.class.php

示例3: ContactView

     $do_contact->iduser = $iduser;
     $do_contact->add();
     $idcontact = $do_contact->getInsertId();
     $do_contact_email->addNew();
     $do_contact_email->idcontact = $idcontact;
     $do_contact_email->email_address = $contact_email;
     $do_contact_email->email_type = 'Work';
     $do_contact_email->add();
     $do_contact->getId($idcontact);
     $do_contact_view = new ContactView();
     $do_contact_view->setUser($iduser);
     $do_contact_view->addFromContact($do_contact);
     $do_activity->addNew();
     $do_activity->idcontact = $idcontact;
     $do_activity->when = date("Y-m-d H:i:s");
     $do_activity->add();
 }
 // For now add multiple notes for multiple attachment
 if (is_array($attachment) && count($attachment) > 0) {
     $attachment_count = 0;
     foreach ($attachment as $attachment) {
         $attachment_count++;
         $do_contact_note->addNew();
         $do_contact_note->iduser = $iduser;
         $do_contact_note->idcontact = $idcontact;
         if ($attachment_count == 1) {
             $do_contact_note->note = $parse_content;
         } else {
             $do_contact_note->note = 'Attachment';
         }
         $do_contact_note->date_added = date("Y-m-d");
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:31,代码来源:ofuz_catch_new.php


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