Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F436399
DiffusionPathQuery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
831 B
Referenced Files
None
Subscribers
None
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'
);
}
protected
function
buildWhereClause
(
AphrontDatabaseConnection
$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
''
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 3, 11:13 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
64773
Default Alt Text
DiffusionPathQuery.php (831 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment