Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
851 B · 43 lines
PHP
1234567891011121314151617181920212223242526272829303132333435363738394041424344<?php
final class DiffusionPathQuery extends Phobject {
private $pathIDs;
public function withPathIDs(array $path_ids) { $this->pathIDs = $path_ids; return $this; }
public function execute() { $conn = id(new PhabricatorRepository())->establishConnection('r');
$where = $this->buildWhereClause($conn);
$results = queryfx_all( $conn, 'SELECT * FROM %T %Q', PhabricatorRepository::TABLE_PATH, $where);
return ipull($results, null, 'id'); }
protected function buildWhereClause(AphrontDatabaseConnection $conn) { $where = array();
if ($this->pathIDs) { $where[] = qsprintf( $conn, 'id IN (%Ld)', $this->pathIDs); }
if ($where) { return qsprintf($conn, 'WHERE %LA', $where); } else { return qsprintf($conn, ''); } }
}