Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889803
PhabricatorPackagesPublisherKeyTransaction.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
PhabricatorPackagesPublisherKeyTransaction.php
View Options
<?php
final
class
PhabricatorPackagesPublisherKeyTransaction
extends
PhabricatorPackagesPublisherTransactionType
{
const
TRANSACTIONTYPE
=
'packages.publisher.key'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getPublisherKey
(
)
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setPublisherKey
(
$value
)
;
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
(
)
;
if
(
$this
->
isEmptyTextTransaction
(
$object
->
getName
(
)
,
$xactions
)
)
{
$errors
[
]
=
$this
->
newRequiredError
(
pht
(
'Publishers must have a unique publisher key.'
)
)
;
}
if
(
!
$this
->
isNewObject
(
)
)
{
foreach
(
$xactions
as
$xaction
)
{
$errors
[
]
=
$this
->
newInvalidError
(
pht
(
'Once a publisher is created, its key can not be changed.'
)
,
$xaction
)
;
}
}
foreach
(
$xactions
as
$xaction
)
{
$value
=
$xaction
->
getNewValue
(
)
;
try
{
PhabricatorPackagesPublisher
::
assertValidPublisherKey
(
$value
)
;
}
catch
(
Exception
$ex
)
{
$errors
[
]
=
$this
->
newInvalidError
(
$ex
->
getMessage
(
)
,
$xaction
)
;
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 12:40 (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124669
Default Alt Text
PhabricatorPackagesPublisherKeyTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment