| @@ -130,10 +130,18 @@ | ||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | $editorDataArray->startSection = $startSection; |
| 133 | 133 | |
| 134 | + // make document model base on editor data | |
| 134 | 135 | $mapper = new Mapper(); |
| 135 | - return $mapper->hydrate( $editorDataArray, $documentId )->get(); | |
| 136 | + $documentModel = $mapper->hydrate( $editorDataArray, $documentId )->get(); | |
| 137 | + | |
| 138 | + // set document entity properties | |
| 139 | + $documentModel->setDocumentId( $documentId ); | |
| 140 | + $documentModel->setUnpublishedNotice( $documentId ); | |
| 141 | + $documentModel->setEntityProperty( 'status', $this->getStatus( $documentId ) ); | |
| 142 | + | |
| 143 | + return $documentModel; | |
| 136 | 144 | } |
| 137 | 145 | |
| 138 | 146 | /** |
| 139 | 147 | * Retrieves custom css file of a document if exists |
| @@ -155,5 +163,14 @@ | ||
| 155 | 163 | return false; |
| 156 | 164 | } |
| 157 | 165 | |
| 158 | 166 | |
| 167 | + /** | |
| 168 | + * Get status of document | |
| 169 | + * | |
| 170 | + * @param int $documentID | |
| 171 | + * @return string | |
| 172 | + */ | |
| 173 | + public function getStatus( $documentID ) { | |
| 174 | + return \Depicter::document()->repository()->getStatus( $documentID ); | |
| 175 | + } | |
| 159 | 176 | } |