Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F801557
PhrictionDocumentMoveAwayTransaction.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
PhrictionDocumentMoveAwayTransaction.php
View Options
<?php
final
class
PhrictionDocumentMoveAwayTransaction
extends
PhrictionDocumentTransactionType
{
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
);
}
public
function
applyExternalEffects
(
$object
,
$value
)
{
$dict
=
$value
;
$this
->
getEditor
()->
getNewContent
()->
setContent
(
''
);
$this
->
getEditor
()->
getNewContent
()->
setChangeType
(
PhrictionChangeType
::
CHANGE_MOVE_AWAY
);
$this
->
getEditor
()->
getNewContent
()->
setChangeRef
(
$dict
[
'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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, May 29, 11:46 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
176376
Default Alt Text
PhrictionDocumentMoveAwayTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment