Differential D7367 Diff 16584 src/applications/transactions/phid/PhabricatorApplicationTransactionPHIDTypeTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/phid/PhabricatorApplicationTransactionPHIDTypeTransaction.php
Show All 14 Lines | final class PhabricatorApplicationTransactionPHIDTypeTransaction | ||||
public function newObject() { | public function newObject() { | ||||
// NOTE: We could produce an object here, but we'd need to take a PHID type | // NOTE: We could produce an object here, but we'd need to take a PHID type | ||||
// and subtype to do so. Currently, we never write edges to transactions, | // and subtype to do so. Currently, we never write edges to transactions, | ||||
// so leave this unimplemented for the moment. | // so leave this unimplemented for the moment. | ||||
return null; | return null; | ||||
} | } | ||||
protected function buildQueryForObjects( | |||||
PhabricatorObjectQuery $object_query, | |||||
array $phids) { | |||||
throw new Exception(); | |||||
} | |||||
public function loadObjects( | public function loadObjects( | ||||
PhabricatorObjectQuery $object_query, | PhabricatorObjectQuery $object_query, | ||||
array $phids) { | array $phids) { | ||||
static $queries; | static $queries; | ||||
if ($queries === null) { | if ($queries === null) { | ||||
$objects = id(new PhutilSymbolLoader()) | $objects = id(new PhutilSymbolLoader()) | ||||
->setAncestorClass('PhabricatorApplicationTransactionQuery') | ->setAncestorClass('PhabricatorApplicationTransactionQuery') | ||||
Show All 19 Lines | public function loadObjects( | ||||
$results = array(); | $results = array(); | ||||
foreach ($phid_subtypes as $subtype => $subtype_phids) { | foreach ($phid_subtypes as $subtype => $subtype_phids) { | ||||
$query = idx($queries, $subtype); | $query = idx($queries, $subtype); | ||||
if (!$query) { | if (!$query) { | ||||
continue; | continue; | ||||
} | } | ||||
$xactions = id(clone $query) | $xaction_query = id(clone $query) | ||||
->setViewer($object_query->getViewer()) | ->setViewer($object_query->getViewer()) | ||||
->setParentQuery($object_query) | ->setParentQuery($object_query) | ||||
->withPHIDs($subtype_phids) | ->withPHIDs($subtype_phids); | ||||
->execute(); | |||||
if (!$xaction_query->canViewerUseQueryApplication()) { | |||||
$object_query->addPolicyFilteredPHIDs(array_fuse($subtype_phids)); | |||||
continue; | |||||
} | |||||
$xactions = $xaction_query->execute(); | |||||
$results += mpull($xactions, null, 'getPHID'); | $results += mpull($xactions, null, 'getPHID'); | ||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
public function loadHandles( | public function loadHandles( | ||||
Show All 10 Lines |