Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2895933
PhrictionDocumentContentTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
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
Jan 19 2025, 22:17 (6 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1129312
Default Alt Text
PhrictionDocumentContentTransaction.php (894 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment