public static function createDocumentFolderFromPostValues($postValues)
    {
        if (isset($postValues['title'], $postValues['path'], $postValues['content'])) {
            $documentFolderObject = new Document();
            $documentFolderObject->title = $postValues['title'];
            $documentFolderObject->slug = StringUtil::slugify($postValues['title']);
            $documentFolderObject->type = 'folder';
            $documentFolderObject->content = json_decode($postValues['content']);

            return $documentFolderObject;
        } else {
            throw new \Exception('Trying to create document folder with invalid data.');
        }
    }