Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100394195
ConpherenceParticipant.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
Thu, Jan 30, 11:45
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Feb 1, 11:45 (1 d, 14 h)
Engine
blob
Format
Raw Data
Handle
23935120
Attached To
rPH Phabricator
ConpherenceParticipant.php
View Options
<?php
final
class
ConpherenceParticipant
extends
ConpherenceDAO
{
protected
$participantPHID
;
protected
$conpherencePHID
;
protected
$participationStatus
;
protected
$behindTransactionPHID
;
protected
$seenMessageCount
;
protected
$dateTouched
;
protected
$settings
=
array
();
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_SERIALIZATION
=>
array
(
'settings'
=>
self
::
SERIALIZATION_JSON
,
),
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'participationStatus'
=>
'uint32'
,
'dateTouched'
=>
'epoch'
,
'seenMessageCount'
=>
'uint64'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'conpherencePHID'
=>
array
(
'columns'
=>
array
(
'conpherencePHID'
,
'participantPHID'
),
'unique'
=>
true
,
),
'unreadCount'
=>
array
(
'columns'
=>
array
(
'participantPHID'
,
'participationStatus'
),
),
'participationIndex'
=>
array
(
'columns'
=>
array
(
'participantPHID'
,
'dateTouched'
,
'id'
),
),
),
)
+
parent
::
getConfiguration
();
}
public
function
getSettings
()
{
return
nonempty
(
$this
->
settings
,
array
());
}
public
function
markUpToDate
(
ConpherenceThread
$conpherence
,
ConpherenceTransaction
$xaction
)
{
if
(!
$this
->
isUpToDate
(
$conpherence
))
{
$this
->
setParticipationStatus
(
ConpherenceParticipationStatus
::
UP_TO_DATE
);
$this
->
setBehindTransactionPHID
(
$xaction
->
getPHID
());
$this
->
setSeenMessageCount
(
$conpherence
->
getMessageCount
());
$this
->
save
();
}
return
$this
;
}
private
function
isUpToDate
(
ConpherenceThread
$conpherence
)
{
return
(
$this
->
getSeenMessageCount
()
==
$conpherence
->
getMessageCount
())
&&
(
$this
->
getParticipationStatus
()
==
ConpherenceParticipationStatus
::
UP_TO_DATE
);
}
}
Event Timeline
Log In to Comment