Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / project / conduit / ProjectConduitAPIMethod.php
blobf6e40f38a389ad31658c39ca49c7e33d11b27a91
1 <?php
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');
16 if (!$projects) {
17 return array();
20 $result = array();
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(),
45 return $result;