Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93074527
PhluxVariableEditor.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
Tue, Nov 26, 00:33
Size
2 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 00:33 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22568035
Attached To
rPH Phabricator
PhluxVariableEditor.php
View Options
<?php
final
class
PhluxVariableEditor
extends
PhabricatorApplicationTransactionEditor
{
public
function
getTransactionTypes
()
{
$types
=
parent
::
getTransactionTypes
();
$types
[]
=
PhluxTransaction
::
TYPE_EDIT_KEY
;
$types
[]
=
PhluxTransaction
::
TYPE_EDIT_VALUE
;
$types
[]
=
PhabricatorTransactions
::
TYPE_VIEW_POLICY
;
$types
[]
=
PhabricatorTransactions
::
TYPE_EDIT_POLICY
;
return
$types
;
}
protected
function
getCustomTransactionOldValue
(
PhabricatorLiskDAO
$object
,
PhabricatorApplicationTransaction
$xaction
)
{
switch
(
$xaction
->
getTransactionType
())
{
case
PhluxTransaction
::
TYPE_EDIT_KEY
:
return
$object
->
getVariableKey
();
case
PhluxTransaction
::
TYPE_EDIT_VALUE
:
return
$object
->
getVariableValue
();
}
return
parent
::
getCustomTransactionOldValue
(
$object
,
$xaction
);
}
protected
function
getCustomTransactionNewValue
(
PhabricatorLiskDAO
$object
,
PhabricatorApplicationTransaction
$xaction
)
{
switch
(
$xaction
->
getTransactionType
())
{
case
PhluxTransaction
::
TYPE_EDIT_KEY
:
case
PhluxTransaction
::
TYPE_EDIT_VALUE
:
return
$xaction
->
getNewValue
();
}
return
parent
::
getCustomTransactionNewValue
(
$object
,
$xaction
);
}
protected
function
applyCustomInternalTransaction
(
PhabricatorLiskDAO
$object
,
PhabricatorApplicationTransaction
$xaction
)
{
switch
(
$xaction
->
getTransactionType
())
{
case
PhluxTransaction
::
TYPE_EDIT_KEY
:
$object
->
setVariableKey
(
$xaction
->
getNewValue
());
return
;
case
PhluxTransaction
::
TYPE_EDIT_VALUE
:
$object
->
setVariableValue
(
$xaction
->
getNewValue
());
return
;
case
PhabricatorTransactions
::
TYPE_VIEW_POLICY
:
$object
->
setViewPolicy
(
$xaction
->
getNewValue
());
return
;
case
PhabricatorTransactions
::
TYPE_EDIT_POLICY
:
$object
->
setEditPolicy
(
$xaction
->
getNewValue
());
return
;
}
return
parent
::
applyCustomInternalTransaction
(
$object
,
$xaction
);
}
protected
function
applyCustomExternalTransaction
(
PhabricatorLiskDAO
$object
,
PhabricatorApplicationTransaction
$xaction
)
{
switch
(
$xaction
->
getTransactionType
())
{
case
PhluxTransaction
::
TYPE_EDIT_KEY
:
case
PhluxTransaction
::
TYPE_EDIT_VALUE
:
return
;
}
return
parent
::
applyCustomExternalTransaction
(
$object
,
$xaction
);
}
}
Event Timeline
Log In to Comment