Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F70521119
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
Sun, Jul 7, 07:28
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jul 9, 07:28 (2 d)
Engine
blob
Format
Raw Data
Handle
18854309
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
);
}
public
function
willWriteRevision
(
DifferentialRevisionEditor
$editor
)
{
$this
->
getRevision
()->
setRepositoryPHID
(
$this
->
value
);
}
}
Event Timeline
Log In to Comment