Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98260696
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
Sat, Jan 11, 13:34
Size
911 B
Mime Type
text/x-php
Expires
Mon, Jan 13, 13:34 (2 d)
Engine
blob
Format
Raw Data
Handle
23546874
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