Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96580235
LegalpadDocumentTextTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Dec 28, 11:51
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 30, 11:51 (2 d)
Engine
blob
Format
Raw Data
Handle
23211122
Attached To
rPH Phabricator
LegalpadDocumentTextTransaction.php
View Options
<?php
final
class
LegalpadDocumentTextTransaction
extends
LegalpadDocumentTransactionType
{
const
TRANSACTIONTYPE
=
'text'
;
public
function
generateOldValue
(
$object
)
{
$body
=
$object
->
getDocumentBody
();
return
$body
->
getText
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$body
=
$object
->
getDocumentBody
();
$body
->
setText
(
$value
);
$object
->
attachDocumentBody
(
$body
);
}
public
function
getTitle
()
{
$old
=
$this
->
getOldValue
();
if
(!
strlen
(
$old
))
{
return
pht
(
'%s set the document text.'
,
$this
->
renderAuthor
());
}
else
{
return
pht
(
'%s updated the document text.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s updated the document text for %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
public
function
hasChangeDetailView
()
{
return
true
;
}
public
function
getMailDiffSectionHeader
()
{
return
pht
(
'CHANGES TO DOCUMENT TEXT'
);
}
public
function
newChangeDetailView
()
{
$viewer
=
$this
->
getViewer
();
return
id
(
new
PhabricatorApplicationTransactionTextDiffDetailView
())
->
setViewer
(
$viewer
)
->
setOldText
(
$this
->
getOldValue
())
->
setNewText
(
$this
->
getNewValue
());
}
public
function
newRemarkupChanges
()
{
$changes
=
array
();
$changes
[]
=
$this
->
newRemarkupChange
()
->
setOldValue
(
$this
->
getOldValue
())
->
setNewValue
(
$this
->
getNewValue
());
return
$changes
;
}
}
Event Timeline
Log In to Comment