Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104621752
PhabricatorTokenCountQuery.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, Mar 10, 23:40
Size
911 B
Mime Type
text/x-php
Expires
Wed, Mar 12, 23:40 (2 d)
Engine
blob
Format
Raw Data
Handle
24810724
Attached To
rPH Phabricator
PhabricatorTokenCountQuery.php
View Options
<?php
final
class
PhabricatorTokenCountQuery
extends
PhabricatorOffsetPagedQuery
{
private
$objectPHIDs
;
public
function
withObjectPHIDs
(
array
$object_phids
)
{
$this
->
objectPHIDs
=
$object_phids
;
return
$this
;
}
final
public
function
execute
()
{
$table
=
new
PhabricatorTokenCount
();
$conn_r
=
$table
->
establishConnection
(
'r'
);
$rows
=
queryfx_all
(
$conn_r
,
'SELECT objectPHID, tokenCount FROM %T %Q %Q'
,
$table
->
getTableName
(),
$this
->
buildWhereClause
(
$conn_r
),
$this
->
buildLimitClause
(
$conn_r
));
return
ipull
(
$rows
,
'tokenCount'
,
'objectPHID'
);
}
private
function
buildWhereClause
(
AphrontDatabaseConnection
$conn_r
)
{
$where
=
array
();
if
(
$this
->
objectPHIDs
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'objectPHID IN (%Ls)'
,
$this
->
objectPHIDs
);
}
return
$this
->
formatWhereClause
(
$where
);
}
}
Event Timeline
Log In to Comment