Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97584275
PhabricatorSpacesExportEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jan 5, 11:37
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 7, 11:37 (2 d)
Engine
blob
Format
Raw Data
Handle
23431056
Attached To
rPH Phabricator
PhabricatorSpacesExportEngineExtension.php
View Options
<?php
final
class
PhabricatorSpacesExportEngineExtension
extends
PhabricatorExportEngineExtension
{
const
EXTENSIONKEY
=
'spaces'
;
public
function
supportsObject
(
$object
)
{
$viewer
=
$this
->
getViewer
();
if
(!
PhabricatorSpacesNamespaceQuery
::
getViewerSpacesExist
(
$viewer
))
{
return
false
;
}
return
(
$object
instanceof
PhabricatorSpacesInterface
);
}
public
function
newExportFields
()
{
return
array
(
id
(
new
PhabricatorPHIDExportField
())
->
setKey
(
'spacePHID'
)
->
setLabel
(
pht
(
'Space PHID'
)),
id
(
new
PhabricatorStringExportField
())
->
setKey
(
'space'
)
->
setLabel
(
pht
(
'Space'
)),
);
}
public
function
newExportData
(
array
$objects
)
{
$viewer
=
$this
->
getViewer
();
$space_phids
=
array
();
foreach
(
$objects
as
$object
)
{
$space_phids
[]
=
PhabricatorSpacesNamespaceQuery
::
getObjectSpacePHID
(
$object
);
}
$handles
=
$viewer
->
loadHandles
(
$space_phids
);
$map
=
array
();
foreach
(
$objects
as
$object
)
{
$space_phid
=
PhabricatorSpacesNamespaceQuery
::
getObjectSpacePHID
(
$object
);
$map
[]
=
array
(
'spacePHID'
=>
$space_phid
,
'space'
=>
$handles
[
$space_phid
]->
getName
(),
);
}
return
$map
;
}
}
Event Timeline
Log In to Comment