Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92489633
HarbormasterBuildableTransaction.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, Nov 20, 18:35
Size
2 KB
Mime Type
text/x-php
Expires
Fri, Nov 22, 18:35 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22449475
Attached To
rPH Phabricator
HarbormasterBuildableTransaction.php
View Options
<?php
final
class
HarbormasterBuildableTransaction
extends
PhabricatorApplicationTransaction
{
const
TYPE_CREATE
=
'harbormaster:buildable:create'
;
const
TYPE_COMMAND
=
'harbormaster:buildable:command'
;
public
function
getApplicationName
()
{
return
'harbormaster'
;
}
public
function
getApplicationTransactionType
()
{
return
HarbormasterBuildablePHIDType
::
TYPECONST
;
}
public
function
getTitle
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_CREATE
:
return
pht
(
'%s created this buildable.'
,
$this
->
renderHandleLink
(
$author_phid
));
case
self
::
TYPE_COMMAND
:
switch
(
$new
)
{
case
HarbormasterBuildCommand
::
COMMAND_RESTART
:
return
pht
(
'%s restarted this buildable.'
,
$this
->
renderHandleLink
(
$author_phid
));
case
HarbormasterBuildCommand
::
COMMAND_RESUME
:
return
pht
(
'%s resumed this buildable.'
,
$this
->
renderHandleLink
(
$author_phid
));
case
HarbormasterBuildCommand
::
COMMAND_STOP
:
return
pht
(
'%s stopped this buildable.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
}
return
parent
::
getTitle
();
}
public
function
getIcon
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_CREATE
:
return
'fa-plus'
;
case
self
::
TYPE_COMMAND
:
switch
(
$new
)
{
case
HarbormasterBuildCommand
::
COMMAND_RESTART
:
return
'fa-backward'
;
case
HarbormasterBuildCommand
::
COMMAND_RESUME
:
return
'fa-play'
;
case
HarbormasterBuildCommand
::
COMMAND_STOP
:
return
'fa-stop'
;
}
}
return
parent
::
getIcon
();
}
public
function
getColor
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_CREATE
:
return
'green'
;
case
self
::
TYPE_COMMAND
:
switch
(
$new
)
{
case
HarbormasterBuildCommand
::
COMMAND_STOP
:
return
'red'
;
}
}
return
parent
::
getColor
();
}
}
Event Timeline
Log In to Comment