Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F115201149
DiffusionPathQuery.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
Fri, May 30, 11:18
Size
803 B
Mime Type
text/x-php
Expires
Sun, Jun 1, 11:18 (2 d)
Engine
blob
Format
Raw Data
Handle
26458228
Attached To
rPH Phabricator
DiffusionPathQuery.php
View Options
<?php
final
class
DiffusionPathQuery
{
private
$pathIDs
;
public
function
withPathIDs
(
array
$path_ids
)
{
$this
->
pathIDs
=
$path_ids
;
return
$this
;
}
public
function
execute
()
{
$conn_r
=
id
(
new
PhabricatorRepository
())->
establishConnection
(
'r'
);
$where
=
$this
->
buildWhereClause
(
$conn_r
);
$results
=
queryfx_all
(
$conn_r
,
'SELECT * FROM %T %Q'
,
PhabricatorRepository
::
TABLE_PATH
,
$where
);
return
ipull
(
$results
,
null
,
'id'
);
}
private
function
buildWhereClause
(
$conn_r
)
{
$where
=
array
();
if
(
$this
->
pathIDs
)
{
$where
[]
=
qsprintf
(
$conn_r
,
'id IN (%Ld)'
,
$this
->
pathIDs
);
}
if
(
$where
)
{
return
'WHERE ('
.
implode
(
') AND ('
,
$where
).
')'
;
}
else
{
return
''
;
}
}
}
Event Timeline
Log In to Comment