Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93629623
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
Sat, Nov 30, 06:57
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 06:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22679854
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