Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4852638
PhortuneMerchantEditor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
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
Mon, Jun 9, 06:45 (3 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1768501
Default Alt Text
PhortuneMerchantEditor.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment