3 abstract class ProjectConduitAPIMethod
extends ConduitAPIMethod
{
5 final public function getApplication() {
6 return PhabricatorApplication
::getByClass('PhabricatorProjectApplication');
9 protected function buildProjectInfoDictionary(PhabricatorProject
$project) {
10 $results = $this->buildProjectInfoDictionaries(array($project));
11 return idx($results, $project->getPHID());
14 protected function buildProjectInfoDictionaries(array $projects) {
15 assert_instances_of($projects, 'PhabricatorProject');
21 foreach ($projects as $project) {
23 $member_phids = $project->getMemberPHIDs();
24 $member_phids = array_values($member_phids);
26 $project_slugs = $project->getSlugs();
27 $project_slugs = array_values(mpull($project_slugs, 'getSlug'));
29 $project_icon = $project->getDisplayIconKey();
31 $result[$project->getPHID()] = array(
32 'id' => $project->getID(),
33 'phid' => $project->getPHID(),
34 'name' => $project->getName(),
35 'profileImagePHID' => $project->getProfileImagePHID(),
36 'icon' => $project_icon,
37 'color' => $project->getColor(),
38 'members' => $member_phids,
39 'slugs' => $project_slugs,
40 'dateCreated' => $project->getDateCreated(),
41 'dateModified' => $project->getDateModified(),