Remove product literal strings in "pht()", part 18
[phabricator.git] / src / infrastructure / export / engine / PhabricatorSpacesExportEngineExtension.php
blob3e187bc8cd92056fa5b9540858b6b35d968c6a19
1 <?php
3 final class PhabricatorSpacesExportEngineExtension
4 extends PhabricatorExportEngineExtension {
6 const EXTENSIONKEY = 'spaces';
8 public function supportsObject($object) {
9 $viewer = $this->getViewer();
11 if (!PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) {
12 return false;
15 return ($object instanceof PhabricatorSpacesInterface);
18 public function newExportFields() {
19 return array(
20 id(new PhabricatorPHIDExportField())
21 ->setKey('spacePHID')
22 ->setLabel(pht('Space PHID')),
23 id(new PhabricatorStringExportField())
24 ->setKey('space')
25 ->setLabel(pht('Space')),
29 public function newExportData(array $objects) {
30 $viewer = $this->getViewer();
32 $space_phids = array();
33 foreach ($objects as $object) {
34 $space_phids[] = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID(
35 $object);
37 $handles = $viewer->loadHandles($space_phids);
39 $map = array();
40 foreach ($objects as $object) {
41 $space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID(
42 $object);
44 $map[] = array(
45 'spacePHID' => $space_phid,
46 'space' => $handles[$space_phid]->getName(),
50 return $map;