Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F549659
PhrictionDocumentContentTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
894 B
Referenced Files
None
Subscribers
None
PhrictionDocumentContentTransaction.php
View Options
<?php
final
class
PhrictionDocumentContentTransaction
extends
PhrictionDocumentEditTransaction
{
const
TRANSACTIONTYPE
=
'content'
;
public
function
applyInternalEffects
(
$object
,
$value
)
{
parent
::
applyInternalEffects
(
$object
,
$value
);
$object
->
setStatus
(
PhrictionDocumentStatus
::
STATUS_EXISTS
);
$this
->
getEditor
()->
setShouldPublishContent
(
$object
,
true
);
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
// NOTE: This is slightly different from the draft validation. Here,
// we're validating that: you can't edit away a document; and you can't
// create an empty document.
$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, 2:15 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
120208
Default Alt Text
PhrictionDocumentContentTransaction.php (894 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment