本文整理汇总了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);
}
示例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();
}
}
示例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");