Page MenuHomePhorge

DiffusionPathQuery.php
No OneTemporary

Size
831 B
Referenced Files
None
Subscribers
None

DiffusionPathQuery.php

<?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

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)

Event Timeline