Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34140224
PhortuneMerchantEditor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
PhortuneMerchantEditor.php
View Options
<?php
final
class
PhortuneMerchantEditor
extends
PhabricatorApplicationTransactionEditor
{
public
function
getEditorApplicationClass
()
{
return
'PhabricatorPhortuneApplication'
;
}
public
function
getEditorObjectsDescription
()
{
return
pht
(
'Phortune Merchants'
);
}
public
function
getCreateObjectTitle
(
$author
,
$object
)
{
return
pht
(
'%s created this merchant.'
,
$author
);
}
public
function
getTransactionTypes
()
{
$types
=
parent
::
getTransactionTypes
();
$types
[]
=
PhabricatorTransactions
::
TYPE_VIEW_POLICY
;
$types
[]
=
PhabricatorTransactions
::
TYPE_EDGE
;
return
$types
;
}
protected
function
validateTransaction
(
PhabricatorLiskDAO
$object
,
$type
,
array
$xactions
)
{
$errors
=
parent
::
validateTransaction
(
$object
,
$type
,
$xactions
);
switch
(
$type
)
{
case
PhabricatorTransactions
::
TYPE_EDGE
:
foreach
(
$xactions
as
$xaction
)
{
switch
(
$xaction
->
getMetadataValue
(
'edge:type'
))
{
case
PhortuneMerchantHasMemberEdgeType
::
EDGECONST
:
$new
=
$xaction
->
getNewValue
();
$set
=
idx
(
$new
,
'-'
,
array
());
$actor_phid
=
$this
->
requireActor
()->
getPHID
();
foreach
(
$set
as
$phid
)
{
if
(
$actor_phid
==
$phid
)
{
$error
=
new
PhabricatorApplicationTransactionValidationError
(
$type
,
pht
(
'Invalid'
),
pht
(
'You can not remove yourself as an merchant manager.'
),
$xaction
);
$errors
[]
=
$error
;
}
}
break
;
}
}
break
;
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Dec 9, 1:00 AM (22 h, 59 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
aa/16/88a0532ac2681aee5d253ccf09e2
Attached To
rPHAB Phabricator
Event Timeline
Log In to Comment