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)) {
15 return ($object instanceof PhabricatorSpacesInterface
);
18 public function newExportFields() {
20 id(new PhabricatorPHIDExportField())
22 ->setLabel(pht('Space PHID')),
23 id(new PhabricatorStringExportField())
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(
37 $handles = $viewer->loadHandles($space_phids);
40 foreach ($objects as $object) {
41 $space_phid = PhabricatorSpacesNamespaceQuery
::getObjectSpacePHID(
45 'spacePHID' => $space_phid,
46 'space' => $handles[$space_phid]->getName(),