| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public static function createDocumentFolderFromPostValues($postValues) |
||
| 25 | { |
||
| 26 | if (isset($postValues['title'], $postValues['path'], $postValues['content'])) { |
||
| 27 | $documentFolderObject = new Document(); |
||
| 28 | $documentFolderObject->title = $postValues['title']; |
||
| 29 | $documentFolderObject->slug = StringUtil::slugify($postValues['title']); |
||
| 30 | $documentFolderObject->type = 'folder'; |
||
| 31 | $documentFolderObject->content = json_decode($postValues['content']); |
||
| 32 | |||
| 33 | return $documentFolderObject; |
||
| 34 | } else { |
||
| 35 | throw new \Exception('Trying to create document folder with invalid data.'); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |