Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F952872
PhabricatorPackagesPublisherNameTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorPackagesPublisherNameTransaction.php
View Options
<?php
final
class
PhabricatorPackagesPublisherNameTransaction
extends
PhabricatorPackagesPublisherTransactionType
{
const
TRANSACTIONTYPE
=
'packages.publisher.name'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getName
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setName
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s changed the name of this publisher from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s updated the name for %s from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
if
(
$this
->
isEmptyTextTransaction
(
$object
->
getName
(),
$xactions
))
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Publishers must have a name.'
));
}
foreach
(
$xactions
as
$xaction
)
{
$value
=
$xaction
->
getNewValue
();
try
{
PhabricatorPackagesPublisher
::
assertValidPublisherName
(
$value
);
}
catch
(
Exception
$ex
)
{
$errors
[]
=
$this
->
newInvalidError
(
$ex
->
getMessage
(),
$xaction
);
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 3:45 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
226575
Default Alt Text
PhabricatorPackagesPublisherNameTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment