Differential D14837 Diff 35892 src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
<?php | <?php | ||||
abstract class PhabricatorApplicationTransactionQuery | abstract class PhabricatorApplicationTransactionQuery | ||||
extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
private $phids; | private $phids; | ||||
private $objectPHIDs; | private $objectPHIDs; | ||||
private $authorPHIDs; | private $authorPHIDs; | ||||
private $transactionTypes; | private $transactionTypes; | ||||
private $needComments = true; | private $needComments = true; | ||||
private $needHandles = true; | private $needHandles = true; | ||||
final public static function newQueryForObject( | |||||
PhabricatorApplicationTransactionInterface $object) { | |||||
$xaction = $object->getApplicationTransactionTemplate(); | |||||
$target_class = get_class($xaction); | |||||
$queries = id(new PhutilClassMapQuery()) | |||||
->setAncestorClass(__CLASS__) | |||||
->execute(); | |||||
foreach ($queries as $query) { | |||||
$query_xaction = $query->getTemplateApplicationTransaction(); | |||||
$query_class = get_class($query_xaction); | |||||
if ($query_class === $target_class) { | |||||
return id(clone $query); | |||||
} | |||||
} | |||||
return null; | |||||
} | |||||
abstract public function getTemplateApplicationTransaction(); | abstract public function getTemplateApplicationTransaction(); | ||||
protected function buildMoreWhereClauses(AphrontDatabaseConnection $conn_r) { | protected function buildMoreWhereClauses(AphrontDatabaseConnection $conn_r) { | ||||
return array(); | return array(); | ||||
} | } | ||||
public function withPHIDs(array $phids) { | public function withPHIDs(array $phids) { | ||||
$this->phids = $phids; | $this->phids = $phids; | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |