Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102291710
DifferentialRepositoryFieldSpecification.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, Feb 19, 04:43
Size
1013 B
Mime Type
text/x-php
Expires
Fri, Feb 21, 04:43 (2 d)
Engine
blob
Format
Raw Data
Handle
24325179
Attached To
rPH Phabricator
DifferentialRepositoryFieldSpecification.php
View Options
<?php
final
class
DifferentialRepositoryFieldSpecification
extends
DifferentialFieldSpecification
{
private
$value
;
public
function
shouldAppearOnEdit
()
{
return
true
;
}
protected
function
didSetRevision
()
{
$this
->
value
=
$this
->
getRevision
()->
getRepositoryPHID
();
}
public
function
setValueFromRequest
(
AphrontRequest
$request
)
{
$value
=
head
(
$request
->
getArr
(
'repositoryPHID'
));
$this
->
value
=
nonempty
(
$value
,
null
);
return
$this
;
}
public
function
getRequiredHandlePHIDsForRevisionEdit
()
{
return
array_filter
(
array
(
$this
->
value
));
}
public
function
renderEditControl
()
{
$value
=
array
();
if
(
$this
->
value
)
{
$value
=
array
(
$this
->
getHandle
(
$this
->
value
),
);
}
return
id
(
new
AphrontFormTokenizerControl
())
->
setLabel
(
'Repository'
)
->
setName
(
'repositoryPHID'
)
->
setUser
(
$this
->
getUser
())
->
setLimit
(
1
)
->
setDatasource
(
'/typeahead/common/repositories/'
)
->
setValue
(
$value
);
}
}
Event Timeline
Log In to Comment