Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90896449
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
Tue, Nov 5, 18:32
Size
907 B
Mime Type
text/x-php
Expires
Thu, Nov 7, 18:32 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22154875
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