Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109747113
PholioTransactionQuery.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, Apr 23, 05:59
Size
1003 B
Mime Type
text/x-php
Expires
Fri, Apr 25, 05:59 (2 d)
Engine
blob
Format
Raw Data
Handle
25754950
Attached To
rPH Phabricator
PholioTransactionQuery.php
View Options
<?php
/**
* @group pholio
*/
final
class
PholioTransactionQuery
extends
PhabricatorOffsetPagedQuery
{
private
$mockIDs
;
public
function
withMockIDs
(
array
$ids
)
{
$this
->
mockIDs
=
$ids
;
return
$this
;
}
public
function
execute
()
{
$table
=
new
PholioTransaction
();
$conn_r
=
$table
->
establishConnection
(
'r'
);
$data
=
queryfx_all
(
$conn_r
,
'SELECT * FROM %T x %Q %Q %Q'
,
$table
->
getTableName
(),
$this
->
buildWhereClause
(
$conn_r
),
$this
->
buildOrderClause
(
$conn_r
),
$this
->
buildLimitClause
(
$conn_r
));
return
$table
->
loadAllFromArray
(
$data
);
}
private
function
buildWhereClause
(
AphrontDatabaseConnection
$conn_r
)
{
$where
=
array
();
if
(
$this
->
mockIDs
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'mockID IN (%Ld)'
,
$this
->
mockIDs
);
}
return
$this
->
formatWhereClause
(
$where
);
}
private
function
buildOrderClause
(
AphrontDatabaseConnection
$conn_r
)
{
return
'ORDER BY id ASC'
;
}
}
Event Timeline
Log In to Comment