Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100693828
PhrictionDocumentEditTransaction.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, Feb 1, 22:48
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Feb 3, 22:48 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24010878
Attached To
rPH Phabricator
PhrictionDocumentEditTransaction.php
View Options
<?php
abstract
class
PhrictionDocumentEditTransaction
extends
PhrictionDocumentVersionTransaction
{
public
function
generateOldValue
(
$object
)
{
if
(
$this
->
getEditor
()->
getIsNewObject
())
{
return
null
;
}
// NOTE: We want to get the newest version of the content here, regardless
// of whether it's published or not.
$actor
=
$this
->
getActor
();
return
id
(
new
PhrictionContentQuery
())
->
setViewer
(
$actor
)
->
withDocumentPHIDs
(
array
(
$object
->
getPHID
()))
->
setOrder
(
'newest'
)
->
setLimit
(
1
)
->
executeOne
()
->
getContent
();
}
public
function
generateNewValue
(
$object
,
$value
)
{
return
$value
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$content
=
$this
->
getNewDocumentContent
(
$object
);
$content
->
setContent
(
$value
);
}
public
function
getActionStrength
()
{
return
1.3
;
}
public
function
getActionName
()
{
return
pht
(
'Edited'
);
}
public
function
getTitle
()
{
return
pht
(
'%s edited the content of this document.'
,
$this
->
renderAuthor
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s edited the content of %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
public
function
getMailDiffSectionHeader
()
{
return
pht
(
'CHANGES TO DOCUMENT CONTENT'
);
}
public
function
hasChangeDetailView
()
{
return
true
;
}
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