Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96532547
ConpherenceParticipantQuery.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
Fri, Dec 27, 17:17
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 29, 17:17 (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
23200196
Attached To
rPH Phabricator
ConpherenceParticipantQuery.php
View Options
<?php
final
class
ConpherenceParticipantQuery
extends
PhabricatorOffsetPagedQuery
{
private
$participantPHIDs
;
public
function
withParticipantPHIDs
(
array
$phids
)
{
$this
->
participantPHIDs
=
$phids
;
return
$this
;
}
public
function
execute
()
{
$table
=
new
ConpherenceParticipant
();
$thread
=
new
ConpherenceThread
();
$conn
=
$table
->
establishConnection
(
'r'
);
$data
=
queryfx_all
(
$conn
,
'SELECT * FROM %T participant JOIN %T thread
ON participant.conpherencePHID = thread.phid %Q %Q %Q'
,
$table
->
getTableName
(),
$thread
->
getTableName
(),
$this
->
buildWhereClause
(
$conn
),
$this
->
buildOrderClause
(
$conn
),
$this
->
buildLimitClause
(
$conn
));
return
$table
->
loadAllFromArray
(
$data
);
}
protected
function
buildWhereClause
(
AphrontDatabaseConnection
$conn
)
{
$where
=
array
();
if
(
$this
->
participantPHIDs
!==
null
)
{
$where
[]
=
qsprintf
(
$conn
,
'participantPHID IN (%Ls)'
,
$this
->
participantPHIDs
);
}
return
$this
->
formatWhereClause
(
$conn
,
$where
);
}
private
function
buildOrderClause
(
AphrontDatabaseConnection
$conn
)
{
return
qsprintf
(
$conn
,
'ORDER BY thread.dateModified DESC, thread.id DESC, participant.id DESC'
);
}
}
Event Timeline
Log In to Comment