Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96151339
PhrictionDocumentMoveAwayTransaction.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
Mon, Dec 23, 04:46
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 04:46 (2 d)
Engine
blob
Format
Raw Data
Handle
23133802
Attached To
rPH Phabricator
PhrictionDocumentMoveAwayTransaction.php
View Options
<?php
final
class
PhrictionDocumentMoveAwayTransaction
extends
PhrictionDocumentVersionTransaction
{
const
TRANSACTIONTYPE
=
'move-away'
;
public
function
generateOldValue
(
$object
)
{
return
null
;
}
public
function
generateNewValue
(
$object
,
$value
)
{
$document
=
$value
;
$dict
=
array
(
'id'
=>
$document
->
getID
(),
'phid'
=>
$document
->
getPHID
(),
'content'
=>
$document
->
getContent
()->
getContent
(),
'title'
=>
$document
->
getContent
()->
getTitle
(),
);
return
$dict
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setStatus
(
PhrictionDocumentStatus
::
STATUS_MOVED
);
$content
=
$this
->
getNewDocumentContent
(
$object
);
$content
->
setContent
(
''
);
$content
->
setChangeType
(
PhrictionChangeType
::
CHANGE_MOVE_AWAY
);
$content
->
setChangeRef
(
$value
[
'id'
]);
}
public
function
getActionName
()
{
return
pht
(
'Moved Away'
);
}
public
function
getTitle
()
{
$new
=
$this
->
getNewValue
();
return
pht
(
'%s moved this document to %s'
,
$this
->
renderAuthor
(),
$this
->
renderHandleLink
(
$new
[
'phid'
]));
}
public
function
getTitleForFeed
()
{
$new
=
$this
->
getNewValue
();
return
pht
(
'%s moved %s to %s'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderHandleLink
(
$new
[
'phid'
]));
}
public
function
getIcon
()
{
return
'fa-arrows'
;
}
public
function
shouldHideForFeed
()
{
return
true
;
}
}
Event Timeline
Log In to Comment