mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
Remove application callsites to "LiskDAO->loadOneRelative()"
Summary: Ref T13218. This is like `loadOneWhere(...)` but with more dark magic. Get rid of it. Test Plan: - Forced `20130219.commitsummarymig.php` to hit this code and ran it with `bin/storage upgrade --force --apply ...`. - Ran `20130409.commitdrev.php` with `bin/storage upgrade --force --apply ...`. - Called `user.search` to indirectly get primary email information. - Did not test Releeph at all. Reviewers: amckinley Reviewed By: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13218 Differential Revision: https://secure.phabricator.com/D19876
This commit is contained in:
parent
5c99163b7c
commit
793f185d29
5 changed files with 18 additions and 23 deletions
|
@ -12,9 +12,9 @@ foreach ($commits as $commit) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $commit->loadOneRelative(
|
$data = id(new PhabricatorRepositoryCommitData())->loadOneWhere(
|
||||||
new PhabricatorRepositoryCommitData(),
|
'commitID = %d',
|
||||||
'commitID');
|
$commit->getID());
|
||||||
|
|
||||||
if (!$data) {
|
if (!$data) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -8,7 +8,9 @@ $commit_table->establishConnection('w');
|
||||||
$edges = 0;
|
$edges = 0;
|
||||||
|
|
||||||
foreach (new LiskMigrationIterator($commit_table) as $commit) {
|
foreach (new LiskMigrationIterator($commit_table) as $commit) {
|
||||||
$data = $commit->loadOneRelative($data_table, 'commitID');
|
$data = $data_table->loadOneWhere(
|
||||||
|
'commitID = %d',
|
||||||
|
$commit->getID());
|
||||||
if (!$data) {
|
if (!$data) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,14 +458,9 @@ final class PhabricatorUser
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadPrimaryEmail() {
|
public function loadPrimaryEmail() {
|
||||||
$email = new PhabricatorUserEmail();
|
return id(new PhabricatorUserEmail())->loadOneWhere(
|
||||||
$conn = $email->establishConnection('r');
|
'userPHID = %s AND isPrimary = 1',
|
||||||
|
$this->getPHID());
|
||||||
return $this->loadOneRelative(
|
|
||||||
$email,
|
|
||||||
'userPHID',
|
|
||||||
'getPHID',
|
|
||||||
qsprintf($conn, '(isPrimary = 1)'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,10 +37,9 @@ final class ReleephGetBranchesConduitAPIMethod extends ReleephConduitAPIMethod {
|
||||||
foreach ($branches as $branch) {
|
foreach ($branches as $branch) {
|
||||||
$full_branch_name = $branch->getName();
|
$full_branch_name = $branch->getName();
|
||||||
|
|
||||||
$cut_point_commit = $branch->loadOneRelative(
|
$cut_point_commit = id(new PhabricatorRepositoryCommit())->loadOneWhere(
|
||||||
id(new PhabricatorRepositoryCommit()),
|
'phid = %s',
|
||||||
'phid',
|
$branch->getCutPointCommitPHID());
|
||||||
'getCutPointCommitPHID');
|
|
||||||
|
|
||||||
$results[] = array(
|
$results[] = array(
|
||||||
'project' => $project->getName(),
|
'project' => $project->getName(),
|
||||||
|
|
|
@ -257,18 +257,17 @@ final class ReleephRequest extends ReleephDAO
|
||||||
/* -( Loading external objects )------------------------------------------- */
|
/* -( Loading external objects )------------------------------------------- */
|
||||||
|
|
||||||
public function loadPhabricatorRepositoryCommit() {
|
public function loadPhabricatorRepositoryCommit() {
|
||||||
return $this->loadOneRelative(
|
return id(new PhabricatorRepositoryCommit())->loadOneWhere(
|
||||||
new PhabricatorRepositoryCommit(),
|
'phid = %s',
|
||||||
'phid',
|
$this->getRequestCommitPHID());
|
||||||
'getRequestCommitPHID');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadPhabricatorRepositoryCommitData() {
|
public function loadPhabricatorRepositoryCommitData() {
|
||||||
$commit = $this->loadPhabricatorRepositoryCommit();
|
$commit = $this->loadPhabricatorRepositoryCommit();
|
||||||
if ($commit) {
|
if ($commit) {
|
||||||
return $commit->loadOneRelative(
|
return id(new PhabricatorRepositoryCommitData())->loadOneWhere(
|
||||||
new PhabricatorRepositoryCommitData(),
|
'commitID = %d',
|
||||||
'commitID');
|
$commit->getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue