Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F438256
PhabricatorEditEngineNameTransaction.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
PhabricatorEditEngineNameTransaction.php
View Options
<?php
final
class
PhabricatorEditEngineNameTransaction
extends
PhabricatorEditEngineTransactionType
{
const
TRANSACTIONTYPE
=
'editengine.config.name'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getName
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setName
(
$value
);
}
public
function
getTitle
()
{
if
(
strlen
(
$this
->
getOldValue
()))
{
return
pht
(
'%s renamed this form from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
else
{
return
pht
(
'%s named this form %s.'
,
$this
->
renderAuthor
(),
$this
->
renderNewValue
());
}
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
foreach
(
$xactions
as
$xaction
)
{
$new
=
$xaction
->
getNewValue
();
if
(!
strlen
(
$new
))
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Form name is required.'
),
$xaction
);
continue
;
}
}
if
(!
$errors
)
{
if
(
$this
->
isEmptyTextTransaction
(
$object
->
getName
(),
$xactions
))
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Forms must have a name.'
));
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 2:17 AM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
62976
Default Alt Text
PhabricatorEditEngineNameTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment