Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1947
WarningCustomField.php
Active
Public
Actions
Authored by
epriestley
on Feb 23 2016, 4:15 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F1125788: WarningCustomField.php
Feb 23 2016, 4:15 PM
2016-02-23 16:15:15 (UTC+0)
Subscribers
None
<?php
final
class
WarningCustomField
extends
DifferentialCustomField
{
public
function
getFieldKey
()
{
return
'mycompany:mycustomfield'
;
}
public
function
shouldAppearInPropertyView
()
{
// This is required or the field won't be loaded on the detail page.
return
true
;
}
public
function
renderPropertyViewValue
(
array
$handles
)
{
// This prevents it from actually rendering a property.
return
null
;
}
public
function
getWarningsForRevisionHeader
(
array
$handles
)
{
$revision
=
$this
->
getObject
();
// Do some magic here to figure out if the branch the revision will land
// onto is bad.
$is_bad
=
some_magic
(
$revision
);
$warnings
=
array
();
if
(
$is_bad
)
{
$warnings
[]
=
pht
(
'IMPORTANT! The branch this revision is targeting has a broken '
.
'build!'
);
}
return
$warnings
;
}
}
Event Timeline
epriestley
created this paste.
Feb 23 2016, 4:15 PM
2016-02-23 16:15:15 (UTC+0)
epriestley
mentioned this in
T10619: Permit custom harbormaster actions from the diffusion/differential pages
.
Mar 20 2016, 9:22 AM
2016-03-20 09:22:17 (UTC+0)
Log In to Comment