Differential D16981 Diff 41025 src/applications/release/query/PhabricatorReleaseReleaseTransactionQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/release/query/PhabricatorReleaseReleaseTransactionQuery.php
- This file was added.
<?php | |||||
final class PhabricatorReleaseReleaseTransactionQuery | |||||
extends PhabricatorApplicationTransactionQuery { | |||||
private $newOrOldValues = null; | |||||
private $newValues = null; | |||||
public function withNewOrOldValues($values) { | |||||
$this->newOrOldValues = $values; | |||||
return $this; | |||||
} | |||||
public function withNewValues($values) { | |||||
$this->newValues = $values; | |||||
return $this; | |||||
} | |||||
public function getTemplateApplicationTransaction() { | |||||
return new PhabricatorReleaseReleaseTransaction(); | |||||
} | |||||
protected function buildMoreWhereClauses( | |||||
AphrontDatabaseConnection $conn_r) { | |||||
$where = array(); | |||||
if ($this->newOrOldValues) { | |||||
$jsonized = array(); | |||||
foreach ($this->newOrOldValues as $value) { | |||||
$jsonized[] = phutil_json_encode($value); | |||||
} | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'(newValue in (%Ls) OR oldValue in (%Ls))', | |||||
$jsonized, | |||||
$jsonized); | |||||
} | |||||
if ($this->newValues) { | |||||
$jsonized = array(); | |||||
foreach ($this->newValues as $value) { | |||||
$jsonized[] = phutil_json_encode($value); | |||||
} | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'newValue in (%Ls)', | |||||
$jsonized); | |||||
} | |||||
return $where; | |||||
} | |||||
} |