Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F116816444
HeraldEditLogQuery.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, Jun 9, 11:11
Size
998 B
Mime Type
text/x-php
Expires
Wed, Jun 11, 11:11 (2 d)
Engine
blob
Format
Raw Data
Handle
26528212
Attached To
rPH Phabricator
HeraldEditLogQuery.php
View Options
<?php
final
class
HeraldEditLogQuery
extends
PhabricatorOffsetPagedQuery
{
private
$ruleIDs
;
public
function
withRuleIDs
(
array
$rule_ids
)
{
$this
->
ruleIDs
=
$rule_ids
;
return
$this
;
}
public
function
execute
()
{
$table
=
new
HeraldRuleEdit
();
$conn_r
=
$table
->
establishConnection
(
'r'
);
$where
=
$this
->
buildWhereClause
(
$conn_r
);
$order
=
$this
->
buildOrderClause
(
$conn_r
);
$limit
=
$this
->
buildLimitClause
(
$conn_r
);
$data
=
queryfx_all
(
$conn_r
,
'SELECT log.* FROM %T log %Q %Q %Q'
,
$table
->
getTableName
(),
$where
,
$order
,
$limit
);
return
$table
->
loadAllFromArray
(
$data
);
}
private
function
buildWhereClause
(
$conn_r
)
{
$where
=
array
();
if
(
$this
->
ruleIDs
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'ruleID IN (%Ld)'
,
$this
->
ruleIDs
);
}
return
$this
->
formatWhereClause
(
$where
);
}
private
function
buildOrderClause
(
$conn_r
)
{
return
'ORDER BY id DESC'
;
}
}
Event Timeline
Log In to Comment