Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1125788
WarningCustomField.php
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
epriestley
Feb 23 2016, 4:15 PM
2016-02-23 16:15:15 (UTC+0)
Size
888 B
Referenced Files
None
Subscribers
None
WarningCustomField.php
View Options
<?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
;
}
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
61220
Default Alt Text
WarningCustomField.php (888 B)
Attached To
Mode
P1947 WarningCustomField.php
Attached
Detach File
Event Timeline
Log In to Comment