Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98594608
HeraldTokenizerFieldValue.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
Tue, Jan 14, 16:45
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jan 16, 16:45 (2 d)
Engine
blob
Format
Raw Data
Handle
23601242
Attached To
rPH Phabricator
HeraldTokenizerFieldValue.php
View Options
<?php
final
class
HeraldTokenizerFieldValue
extends
HeraldFieldValue
{
private
$key
;
private
$datasource
;
public
function
setKey
(
$key
)
{
$this
->
key
=
$key
;
return
$this
;
}
public
function
getKey
()
{
return
$this
->
key
;
}
public
function
setDatasource
(
PhabricatorTypeaheadDatasource
$datasource
)
{
$this
->
datasource
=
$datasource
;
return
$this
;
}
public
function
getDatasource
()
{
return
$this
->
datasource
;
}
public
function
getFieldValueKey
()
{
if
(
$this
->
getKey
()
===
null
)
{
throw
new
PhutilInvalidStateException
(
'setKey'
);
}
return
'tokenizer.'
.
$this
->
getKey
();
}
public
function
getControlType
()
{
return
self
::
CONTROL_TOKENIZER
;
}
protected
function
getControlTemplate
()
{
if
(
$this
->
getDatasource
()
===
null
)
{
throw
new
PhutilInvalidStateException
(
'setDatasource'
);
}
$datasource
=
$this
->
getDatasource
();
$datasource
->
setViewer
(
$this
->
getViewer
());
return
array
(
'tokenizer'
=>
array
(
'datasourceURI'
=>
$datasource
->
getDatasourceURI
(),
'browseURI'
=>
$datasource
->
getBrowseURI
(),
'placeholder'
=>
$datasource
->
getPlaceholderText
(),
),
);
}
public
function
renderFieldValue
(
$value
)
{
$viewer
=
$this
->
getViewer
();
return
$viewer
->
renderHandleList
((
array
)
$value
)->
setAsInline
(
true
);
}
}
Event Timeline
Log In to Comment