/** * Save the post * * @param DataObject $post * @param type $data */ public function savePost(DataObject $post, $data) { if ($post->checkPerm('Write') && isset($data['Content'])) { $post->Content = $data['Content']; if ($this->securityContext->getMember()->Balance >= MicroBlogMember::BALANCE_THRESHOLD) { $post->analyseContent(); $post->write(); } else { $this->queuedJobService->queueJob(new ProcessPostJob($post)); } $html = $post->renderWith('PostContent'); return $post; } }