diff --git a/resources/sql/patches/20130219.commitsummarymig.php b/resources/sql/patches/20130219.commitsummarymig.php index 60bdd1542c..f47016804d 100644 --- a/resources/sql/patches/20130219.commitsummarymig.php +++ b/resources/sql/patches/20130219.commitsummarymig.php @@ -12,9 +12,9 @@ foreach ($commits as $commit) { continue; } - $data = $commit->loadOneRelative( - new PhabricatorRepositoryCommitData(), - 'commitID'); + $data = id(new PhabricatorRepositoryCommitData())->loadOneWhere( + 'commitID = %d', + $commit->getID()); if (!$data) { continue; diff --git a/resources/sql/patches/20130409.commitdrev.php b/resources/sql/patches/20130409.commitdrev.php index fb556f1846..a264e8edeb 100644 --- a/resources/sql/patches/20130409.commitdrev.php +++ b/resources/sql/patches/20130409.commitdrev.php @@ -8,7 +8,9 @@ $commit_table->establishConnection('w'); $edges = 0; foreach (new LiskMigrationIterator($commit_table) as $commit) { - $data = $commit->loadOneRelative($data_table, 'commitID'); + $data = $data_table->loadOneWhere( + 'commitID = %d', + $commit->getID()); if (!$data) { continue; } diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php index 7717fbf18c..5d310378e0 100644 --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -458,14 +458,9 @@ final class PhabricatorUser } public function loadPrimaryEmail() { - $email = new PhabricatorUserEmail(); - $conn = $email->establishConnection('r'); - - return $this->loadOneRelative( - $email, - 'userPHID', - 'getPHID', - qsprintf($conn, '(isPrimary = 1)')); + return id(new PhabricatorUserEmail())->loadOneWhere( + 'userPHID = %s AND isPrimary = 1', + $this->getPHID()); } diff --git a/src/applications/releeph/conduit/ReleephGetBranchesConduitAPIMethod.php b/src/applications/releeph/conduit/ReleephGetBranchesConduitAPIMethod.php index 469713ce39..5516b4edb6 100644 --- a/src/applications/releeph/conduit/ReleephGetBranchesConduitAPIMethod.php +++ b/src/applications/releeph/conduit/ReleephGetBranchesConduitAPIMethod.php @@ -37,10 +37,9 @@ final class ReleephGetBranchesConduitAPIMethod extends ReleephConduitAPIMethod { foreach ($branches as $branch) { $full_branch_name = $branch->getName(); - $cut_point_commit = $branch->loadOneRelative( - id(new PhabricatorRepositoryCommit()), - 'phid', - 'getCutPointCommitPHID'); + $cut_point_commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( + 'phid = %s', + $branch->getCutPointCommitPHID()); $results[] = array( 'project' => $project->getName(), diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php index c071600ec7..a877192107 100644 --- a/src/applications/releeph/storage/ReleephRequest.php +++ b/src/applications/releeph/storage/ReleephRequest.php @@ -257,18 +257,17 @@ final class ReleephRequest extends ReleephDAO /* -( Loading external objects )------------------------------------------- */ public function loadPhabricatorRepositoryCommit() { - return $this->loadOneRelative( - new PhabricatorRepositoryCommit(), - 'phid', - 'getRequestCommitPHID'); + return id(new PhabricatorRepositoryCommit())->loadOneWhere( + 'phid = %s', + $this->getRequestCommitPHID()); } public function loadPhabricatorRepositoryCommitData() { $commit = $this->loadPhabricatorRepositoryCommit(); if ($commit) { - return $commit->loadOneRelative( - new PhabricatorRepositoryCommitData(), - 'commitID'); + return id(new PhabricatorRepositoryCommitData())->loadOneWhere( + 'commitID = %d', + $commit->getID()); } }