public function beforeSave($insert) { if (!parent::beforeSave($insert)) { return false; } $this->content = PostService::contentTweet($this->content, $this); return true; }
/** * 内容@用户会有通知 * @param User $fromUser * @param Post $post * @param string $rawContent * @throws Exception */ public function newPostNotify(User $fromUser, Post $post, $rawContent = '') { $this->batchNotify('at_' . $post->type, $fromUser, $this->removeDuplication(PostService::parse($rawContent)), $post); }