Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103064469
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
Wed, Feb 26, 23:54
Size
907 B
Mime Type
text/x-php
Expires
Fri, Feb 28, 23:54 (2 d)
Engine
blob
Format
Raw Data
Handle
24364957
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
;
}
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'
);
}
protected
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