Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92481786
ReleephProductTransaction.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, 16:35
Size
2 KB
Mime Type
text/x-php
Expires
Fri, Nov 22, 16:35 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22444992
Attached To
rPH Phabricator
ReleephProductTransaction.php
View Options
<?php
final
class
ReleephProductTransaction
extends
PhabricatorApplicationTransaction
{
const
TYPE_ACTIVE
=
'releeph:product:active'
;
public
function
getApplicationName
()
{
return
'releeph'
;
}
public
function
getApplicationTransactionType
()
{
return
ReleephProductPHIDType
::
TYPECONST
;
}
public
function
getColor
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_ACTIVE
:
if
(
$new
)
{
return
'green'
;
}
else
{
return
'black'
;
}
break
;
}
return
parent
::
getColor
();
}
public
function
getIcon
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_ACTIVE
:
if
(
$new
)
{
return
'fa-pencil'
;
}
else
{
return
'fa-times'
;
}
break
;
}
return
parent
::
getIcon
();
}
public
function
getTitle
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_ACTIVE
:
if
(
$new
)
{
return
pht
(
'%s activated this product.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s deactivated this product.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
break
;
}
return
parent
::
getTitle
();
}
public
function
getTitleForFeed
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$object_phid
=
$this
->
getObjectPHID
();
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_ACTIVE
:
if
(
$new
)
{
return
pht
(
'%s activated release product %s.'
,
$this
->
renderHandleLink
(
$author_phid
),
$this
->
renderHandleLink
(
$object_phid
));
}
else
{
return
pht
(
'%s deactivated release product %s.'
,
$this
->
renderHandleLink
(
$author_phid
),
$this
->
renderHandleLink
(
$object_phid
));
}
break
;
}
return
parent
::
getTitleForFeed
();
}
public
function
getNoEffectDescription
()
{
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_ACTIVE
:
return
pht
(
'The product is already in that state.'
);
}
return
parent
::
getNoEffectDescription
();
}
}
Event Timeline
Log In to Comment