Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92443329
HeraldContentSourceField.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
Wed, Nov 20, 08:39
Size
961 B
Mime Type
text/x-php
Expires
Fri, Nov 22, 08:39 (2 d)
Engine
blob
Format
Raw Data
Handle
22442673
Attached To
rPH Phabricator
HeraldContentSourceField.php
View Options
<?php
final
class
HeraldContentSourceField
extends
HeraldField
{
const
FIELDCONST
=
'contentsource'
;
public
function
getHeraldFieldName
()
{
return
pht
(
'Content source'
);
}
public
function
getFieldGroupKey
()
{
return
HeraldEditFieldGroup
::
FIELDGROUPKEY
;
}
public
function
getHeraldFieldValue
(
$object
)
{
return
$this
->
getAdapter
()->
getContentSource
()->
getSource
();
}
public
function
getHeraldFieldConditions
()
{
return
array
(
HeraldAdapter
::
CONDITION_IS
,
HeraldAdapter
::
CONDITION_IS_NOT
,
);
}
public
function
getHeraldFieldValueType
(
$condition
)
{
$map
=
PhabricatorContentSource
::
getAllContentSources
();
$map
=
mpull
(
$map
,
'getSourceName'
);
asort
(
$map
);
return
id
(
new
HeraldSelectFieldValue
())
->
setKey
(
self
::
FIELDCONST
)
->
setDefault
(
PhabricatorWebContentSource
::
SOURCECONST
)
->
setOptions
(
$map
);
}
public
function
supportsObject
(
$object
)
{
return
true
;
}
}
Event Timeline
Log In to Comment