Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92671217
PhabricatorJSONExportFormat.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
Fri, Nov 22, 15:17
Size
816 B
Mime Type
text/x-php
Expires
Sun, Nov 24, 15:17 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
22483627
Attached To
rPH Phabricator
PhabricatorJSONExportFormat.php
View Options
<?php
final
class
PhabricatorJSONExportFormat
extends
PhabricatorExportFormat
{
const
EXPORTKEY
=
'json'
;
private
$objects
=
array
();
public
function
getExportFormatName
()
{
return
'JSON (.json)'
;
}
public
function
isExportFormatEnabled
()
{
return
true
;
}
public
function
getFileExtension
()
{
return
'json'
;
}
public
function
getMIMEContentType
()
{
return
'application/json'
;
}
public
function
addObject
(
$object
,
array
$fields
,
array
$map
)
{
$values
=
array
();
foreach
(
$fields
as
$key
=>
$field
)
{
$value
=
$map
[
$key
];
$value
=
$field
->
getNaturalValue
(
$value
);
$values
[
$key
]
=
$value
;
}
$this
->
objects
[]
=
$values
;
}
public
function
newFileData
()
{
return
id
(
new
PhutilJSON
())
->
encodeAsList
(
$this
->
objects
);
}
}
Event Timeline
Log In to Comment