Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108007931
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
Sun, Apr 13, 02:43
Size
816 B
Mime Type
text/x-php
Expires
Tue, Apr 15, 02:43 (1 d, 5 h)
Engine
blob
Format
Raw Data
Handle
25504796
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