/** * Returns emails of users who posted a comment to a page and left their email * * @return array */ protected function getCommentReplyEmails($page) { $comments = $this->loader->getClass('ManualComment_Model')->findForPageWithEmail($page); $emails = array(); foreach ($comments as $comment) { $emails[$comment->email] = 1; } return array_keys($emails); }
/** * Saves a comment and sets a flash message * * @param Smut_Request $req */ protected function saveComment(Smut_Request $req) { $comment = $this->loader->getClass('ManualComment_Model'); $comment->page = $req->page; $comment->name = $req->name; $comment->email = $req->email; $comment->body = $req->comment; $comment->dateCreated = date('Y-m-d H:i:s'); $comment->save(); }