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