Differential D19664 Diff 47003 src/applications/phriction/xaction/PhrictionDocumentDraftTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/xaction/PhrictionDocumentDraftTransaction.php
<?php | <?php | ||||
final class PhrictionDocumentDraftTransaction | final class PhrictionDocumentDraftTransaction | ||||
extends PhrictionDocumentEditTransaction { | extends PhrictionDocumentEditTransaction { | ||||
const TRANSACTIONTYPE = 'draft'; | const TRANSACTIONTYPE = 'draft'; | ||||
public function applyInternalEffects($object, $value) { | public function applyInternalEffects($object, $value) { | ||||
parent::applyInternalEffects($object, $value); | parent::applyInternalEffects($object, $value); | ||||
$this->getEditor()->setShouldPublishContent($object, false); | $this->getEditor()->setShouldPublishContent($object, false); | ||||
} | } | ||||
public function shouldHideForFeed() { | |||||
return true; | |||||
} | |||||
public function validateTransactions($object, array $xactions) { | public function validateTransactions($object, array $xactions) { | ||||
$errors = array(); | $errors = array(); | ||||
// NOTE: We're only validating that you can't edit a document down to | // 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 | // nothing in a draft transaction. Alone, this doesn't prevent you from | ||||
// creating a document with no content. The content transaction has | // creating a document with no content. The content transaction has | ||||
// validation for that. | // validation for that. | ||||
Show All 14 Lines |