Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99639812
FundBackerEditor.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, Jan 25, 22:30
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Jan 27, 22:30 (2 d)
Engine
blob
Format
Raw Data
Handle
23837109
Attached To
rPH Phabricator
FundBackerEditor.php
View Options
<?php
final
class
FundBackerEditor
extends
PhabricatorApplicationTransactionEditor
{
public
function
getEditorApplicationClass
()
{
return
'PhabricatorFundApplication'
;
}
public
function
getEditorObjectsDescription
()
{
return
pht
(
'Fund Backing'
);
}
public
function
getTransactionTypes
()
{
$types
=
parent
::
getTransactionTypes
();
$types
[]
=
FundBackerTransaction
::
TYPE_STATUS
;
$types
[]
=
FundBackerTransaction
::
TYPE_REFUND
;
return
$types
;
}
protected
function
getCustomTransactionOldValue
(
PhabricatorLiskDAO
$object
,
PhabricatorApplicationTransaction
$xaction
)
{
switch
(
$xaction
->
getTransactionType
())
{
case
FundBackerTransaction
::
TYPE_STATUS
:
return
$object
->
getStatus
();
case
FundBackerTransaction
::
TYPE_REFUND
:
return
null
;
}
return
parent
::
getCustomTransactionOldValue
(
$object
,
$xaction
);
}
protected
function
getCustomTransactionNewValue
(
PhabricatorLiskDAO
$object
,
PhabricatorApplicationTransaction
$xaction
)
{
switch
(
$xaction
->
getTransactionType
())
{
case
FundBackerTransaction
::
TYPE_STATUS
:
case
FundBackerTransaction
::
TYPE_REFUND
:
return
$xaction
->
getNewValue
();
}
return
parent
::
getCustomTransactionNewValue
(
$object
,
$xaction
);
}
protected
function
applyCustomInternalTransaction
(
PhabricatorLiskDAO
$object
,
PhabricatorApplicationTransaction
$xaction
)
{
switch
(
$xaction
->
getTransactionType
())
{
case
FundBackerTransaction
::
TYPE_STATUS
:
$object
->
setStatus
(
$xaction
->
getNewValue
());
return
;
case
FundBackerTransaction
::
TYPE_REFUND
:
return
;
}
return
parent
::
applyCustomInternalTransaction
(
$object
,
$xaction
);
}
protected
function
applyCustomExternalTransaction
(
PhabricatorLiskDAO
$object
,
PhabricatorApplicationTransaction
$xaction
)
{
switch
(
$xaction
->
getTransactionType
())
{
case
FundBackerTransaction
::
TYPE_STATUS
:
case
FundBackerTransaction
::
TYPE_REFUND
:
return
;
}
return
parent
::
applyCustomExternalTransaction
(
$object
,
$xaction
);
}
}
Event Timeline
Log In to Comment