2012-01-18 01:29:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group conduit
|
|
|
|
*/
|
|
|
|
abstract class ConduitAPI_project_Method extends ConduitAPIMethod {
|
|
|
|
|
|
|
|
protected function buildProjectInfoDictionary(PhabricatorProject $project) {
|
|
|
|
$results = $this->buildProjectInfoDictionaries(array($project));
|
|
|
|
return idx($results, $project->getPHID());
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function buildProjectInfoDictionaries(array $projects) {
|
2012-04-03 21:10:45 +02:00
|
|
|
assert_instances_of($projects, 'PhabricatorProject');
|
2012-01-18 01:29:35 +01:00
|
|
|
if (!$projects) {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = array();
|
|
|
|
foreach ($projects as $project) {
|
|
|
|
|
2012-08-07 20:55:00 +02:00
|
|
|
$member_phids = $project->getMemberPHIDs();
|
2012-01-18 01:29:35 +01:00
|
|
|
$member_phids = array_values($member_phids);
|
|
|
|
|
|
|
|
$result[$project->getPHID()] = array(
|
|
|
|
'id' => $project->getID(),
|
|
|
|
'phid' => $project->getPHID(),
|
|
|
|
'name' => $project->getName(),
|
|
|
|
'members' => $member_phids,
|
|
|
|
'dateCreated' => $project->getDateCreated(),
|
|
|
|
'dateModified' => $project->getDateModified(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|