Improve implementation of ManiphestTaskQuery

Summary:
Currently, we have a single `projectPHIDs` field, and a separate flag which makes it act like AND or OR.

This is silly. Make two separate methods for setting `AND` vs `OR` projects. This also simplifies the implmentation.

This doesn't change the UI or any behavior (yet), it just makes the API more usable.

Test Plan: Loaded homepage, "All Projects" task view, verified queries made sense and returned correct results. Grepped for changed method name.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1610

Differential Revision: https://secure.phabricator.com/D3630
This commit is contained in:
epriestley
2012-10-04 15:30:51 -07:00
parent 689c98c47c
commit 030726b144
4 changed files with 63 additions and 42 deletions

View File

@@ -84,8 +84,7 @@ final class PhabricatorProjectListController
$groups = array();
if ($project_phids) {
$query = id(new ManiphestTaskQuery())
->withProjects($project_phids)
->withAnyProject(true)
->withAnyProjects($project_phids)
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
->setLimit(PHP_INT_MAX);