Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99230521
PhortuneMerchantTransaction.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, Jan 22, 14:36
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 24, 14:36 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23746290
Attached To
rPH Phabricator
PhortuneMerchantTransaction.php
View Options
<?php
final
class
PhortuneMerchantTransaction
extends
PhabricatorApplicationTransaction
{
const
TYPE_NAME
=
'merchant:name'
;
const
TYPE_DESCRIPTION
=
'merchant:description'
;
public
function
getApplicationName
()
{
return
'phortune'
;
}
public
function
getApplicationTransactionType
()
{
return
PhortuneMerchantPHIDType
::
TYPECONST
;
}
public
function
getApplicationTransactionCommentObject
()
{
return
null
;
}
public
function
getTitle
()
{
$author_phid
=
$this
->
getAuthorPHID
();
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_NAME
:
if
(
$old
===
null
)
{
return
pht
(
'%s created this merchant.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
else
{
return
pht
(
'%s renamed this merchant from "%s" to "%s".'
,
$this
->
renderHandleLink
(
$author_phid
),
$old
,
$new
);
}
break
;
case
self
::
TYPE_DESCRIPTION
:
return
pht
(
'%s updated the description for this merchant.'
,
$this
->
renderHandleLink
(
$author_phid
));
}
return
parent
::
getTitle
();
}
public
function
shouldHide
()
{
$old
=
$this
->
getOldValue
();
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_DESCRIPTION
:
return
(
$old
===
null
);
}
return
parent
::
shouldHide
();
}
public
function
hasChangeDetails
()
{
switch
(
$this
->
getTransactionType
())
{
case
self
::
TYPE_DESCRIPTION
:
return
(
$this
->
getOldValue
()
!==
null
);
}
return
parent
::
hasChangeDetails
();
}
public
function
renderChangeDetails
(
PhabricatorUser
$viewer
)
{
return
$this
->
renderTextCorpusChangeDetails
(
$viewer
,
$this
->
getOldValue
(),
$this
->
getNewValue
());
}
}
Event Timeline
Log In to Comment