Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99126703
PonderCommentQuery.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, Jan 20, 20:27
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Jan 22, 20:27 (2 d)
Engine
blob
Format
Raw Data
Handle
23711347
Attached To
rPH Phabricator
PonderCommentQuery.php
View Options
<?php
final
class
PonderCommentQuery
extends
PhabricatorQuery
{
private
$ids
;
private
$authorPHID
;
private
$targetPHIDs
;
public
function
withIDs
(
$qids
)
{
$this
->
ids
=
$qids
;
return
$this
;
}
public
function
withTargetPHIDs
(
$phids
)
{
$this
->
targetPHIDs
=
$phids
;
return
$this
;
}
public
function
withAuthorPHID
(
$phid
)
{
$this
->
authorPHID
=
$phid
;
return
$this
;
}
private
function
buildWhereClause
(
$conn_r
)
{
$where
=
array
();
if
(
$this
->
ids
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'id in (%Ls)'
,
$this
->
ids
);
}
if
(
$this
->
authorPHID
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'authorPHID = %s'
,
$this
->
authorPHID
);
}
if
(
$this
->
targetPHIDs
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'targetPHID in (%Ls)'
,
$this
->
targetPHIDs
);
}
return
$this
->
formatWhereClause
(
$where
);
}
private
function
buildOrderByClause
(
$conn_r
)
{
return
'ORDER BY id'
;
}
public
function
execute
()
{
$comment
=
new
PonderComment
();
$conn_r
=
$comment
->
establishConnection
(
'r'
);
$select
=
qsprintf
(
$conn_r
,
'SELECT r.* FROM %T r'
,
$comment
->
getTableName
());
$where
=
$this
->
buildWhereClause
(
$conn_r
);
$order_by
=
$this
->
buildOrderByClause
(
$conn_r
);
return
$comment
->
loadAllFromArray
(
queryfx_all
(
$conn_r
,
'%Q %Q %Q'
,
$select
,
$where
,
$order_by
));
}
}
Event Timeline
Log In to Comment