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


PHP Notification::setUserId方法代码示例

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


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

示例1: Notification

 /**
  * Creates and returns an notification object from a row
  * @param $row array
  * @return Notification object
  */
 function &_returnNotificationFromRow($row)
 {
     $notification = new Notification();
     $notification->setId($row['notification_id']);
     $notification->setUserId($row['user_id']);
     $notification->setDateCreated($row['date_created']);
     $notification->setDateRead($row['date_read']);
     $notification->setContents($row['contents']);
     $notification->setParam($row['param']);
     $notification->setLocation($row['location']);
     $notification->setIsLocalized($row['is_localized']);
     $notification->setContext($row['context']);
     $notification->setAssocType($row['assoc_type']);
     HookRegistry::call('NotificationDAO::_returnNotificationFromRow', array(&$notification, &$row));
     return $notification;
 }
开发者ID:anorton,项目名称:pkp-lib,代码行数:21,代码来源:NotificationDAO.inc.php

示例2: createNotification

 /**
  * Create a new notification with the specified arguments and insert into DB
  * This is a static method
  * @param $userId int
  * @param $contents string
  * @param $param string
  * @param $location string
  * @param $isLocalized bool
  * @param $assocType int
  * @param $assocId int
  * @return Notification object
  */
 function createNotification($userId, $contents, $param, $location, $isLocalized, $assocType)
 {
     $notification = new Notification();
     $context =& Request::getContext();
     $contextId = $context->getId();
     $notification->setUserId($userId);
     $notification->setContents($contents);
     $notification->setParam($param);
     $notification->setLocation($location);
     $notification->setIsLocalized($isLocalized);
     $notification->setAssocType($assocType);
     $notification->setContext($contextId);
     $notificationDao =& DAORegistry::getDAO('NotificationDAO');
     $notificationDao->insertNotification($notification);
     return $notification;
 }
开发者ID:anorton,项目名称:pkp-lib,代码行数:28,代码来源:PKPNotification.inc.php

示例3: createTrivialNotification

 /**
  * Create a new notification with the specified arguments and insert into DB
  * This is a static method
  * @param $title string
  * @param $contents string
  * @param $param string
  * @param $isLocalized boolean
  * @return Notification object
  */
 function createTrivialNotification($title, $contents, $assocType = NOTIFICATION_TYPE_SUCCESS, $param = null, $isLocalized = 1)
 {
     $notification = new Notification();
     $context =& Request::getContext();
     $contextId = $context ? $context->getId() : 0;
     $user =& Request::getUser();
     $notification->setUserId($user->getId());
     $notification->setTitle($title);
     $notification->setContents($contents);
     $notification->setParam($param);
     $notification->setIsLocalized($isLocalized);
     $notification->setContext($contextId);
     $notification->setAssocType($assocType);
     $notification->setLevel(NOTIFICATION_LEVEL_TRIVIAL);
     $notificationDao =& DAORegistry::getDAO('NotificationDAO');
     $notificationDao->insertNotification($notification);
     return $notification;
 }
开发者ID:reedstrm,项目名称:pkp-lib,代码行数:27,代码来源:NotificationManager.inc.php

示例4: notify

 /**
  * Slap a notice onto a user.
  * 
  * @param string $message The message.
  * @param string $url URL fragment (slug/args/) to link to.
  * @return bool
  **/
 public function notify($message, $url)
 {
     $notice = new Notification($this->db);
     $notice->setUserId($this->getUserId());
     $notice->setNotificationDatetime($notice->sysdate());
     $notice->setNotificationText($message);
     $notice->setNotificationUrl($url);
     return $notice->save();
 }
开发者ID:OwlManAtt,项目名称:kittokittokitto,代码行数:16,代码来源:user.class.php


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