Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95987152
HarbormasterBuildTransaction.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, Dec 21, 08:51
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Dec 23, 08:51 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
23094975
Attached To
rPH Phabricator
HarbormasterBuildTransaction.php
View Options
<?php
final
class
HarbormasterBuildTransaction
extends
PhabricatorApplicationTransaction
{
const
TYPE_CREATE
=
'harbormaster:build:create'
;
const
TYPE_COMMAND
=
'harbormaster:build:command'
;
public
function
getApplicationName
()
{
return
'harbormaster'
;
}
public
function
getApplicationTransactionType
()
{
return
HarbormasterBuildPHIDType
::
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 build.'
,
$this
->
renderHandleLink
(
$author_phid
));
case
self
::
TYPE_COMMAND
:
switch
(
$new
)
{
case
HarbormasterBuildCommand
::
COMMAND_RESTART
:
return
pht
(
'%s restarted this build.'
,
$this
->
renderHandleLink
(
$author_phid
));
case
HarbormasterBuildCommand
::
COMMAND_ABORT
:
return
pht
(
'%s aborted this build.'
,
$this
->
renderHandleLink
(
$author_phid
));
case
HarbormasterBuildCommand
::
COMMAND_RESUME
:
return
pht
(
'%s resumed this build.'
,
$this
->
renderHandleLink
(
$author_phid
));
case
HarbormasterBuildCommand
::
COMMAND_PAUSE
:
return
pht
(
'%s paused this build.'
,
$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_PAUSE
:
return
'fa-pause'
;
case
HarbormasterBuildCommand
::
COMMAND_ABORT
:
return
'fa-exclamation-triangle'
;
}
}
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_PAUSE
:
case
HarbormasterBuildCommand
::
COMMAND_ABORT
:
return
'red'
;
}
}
return
parent
::
getColor
();
}
}
Event Timeline
Log In to Comment