Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F536919
PhrictionDocumentDraftTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1007 B
Referenced Files
None
Subscribers
None
PhrictionDocumentDraftTransaction.php
View Options
<?php
final
class
PhrictionDocumentDraftTransaction
extends
PhrictionDocumentEditTransaction
{
const
TRANSACTIONTYPE
=
'draft'
;
public
function
applyInternalEffects
(
$object
,
$value
)
{
parent
::
applyInternalEffects
(
$object
,
$value
);
$this
->
getEditor
()->
setShouldPublishContent
(
$object
,
false
);
}
public
function
shouldHideForFeed
()
{
return
true
;
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
// NOTE: We're only validating that you can't edit a document down to
// nothing in a draft transaction. Alone, this doesn't prevent you from
// creating a document with no content. The content transaction has
// validation for that.
if
(!
$xactions
)
{
return
$errors
;
}
$content
=
$object
->
getContent
()->
getContent
();
if
(
$this
->
isEmptyTextTransaction
(
$content
,
$xactions
))
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Documents must have content.'
));
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 7:33 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
118027
Default Alt Text
PhrictionDocumentDraftTransaction.php (1007 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment