Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80682963
PhabricatorFeedStoryNotification.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Sep 2, 01:56
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Sep 4, 01:56 (2 d)
Engine
blob
Format
Raw Data
Handle
20422621
Attached To
rPH Phabricator
PhabricatorFeedStoryNotification.php
View Options
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final
class
PhabricatorFeedStoryNotification
extends
PhabricatorFeedDAO
{
protected
$userPHID
;
protected
$primaryObjectPHID
;
protected
$chronologicalKey
;
protected
$hasViewed
;
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_IDS
=>
self
::
IDS_MANUAL
,
self
::
CONFIG_TIMESTAMPS
=>
false
,
)
+
parent
::
getConfiguration
();
}
static
public
function
updateObjectNotificationViews
(
PhabricatorUser
$user
,
$object_phid
)
{
if
(
PhabricatorEnv
::
getEnvConfig
(
'notification.enabled'
))
{
$unguarded
=
AphrontWriteGuard
::
beginScopedUnguardedWrites
();
$notification_table
=
new
PhabricatorFeedStoryNotification
();
$conn
=
$notification_table
->
establishConnection
(
'w'
);
queryfx
(
$conn
,
"UPDATE %T
SET hasViewed = 1
WHERE userPHID = %s
AND primaryObjectPHID = %s
AND hasViewed = 0"
,
$notification_table
->
getTableName
(),
$user
->
getPHID
(),
$object_phid
);
unset
(
$unguarded
);
}
}
}
Event Timeline
Log In to Comment