OEModule\OphCoMessaging\controllers\DefaultController::markCommentRead PHP Method

markCommentRead() protected method

protected markCommentRead ( $el )
    protected function markCommentRead($el)
    {
        $transaction = \Yii::app()->db->beginTransaction();
        try {
            foreach ($el->comments as $comment) {
                $comment->marked_as_read = true;
                $comment->save();
            }
            $this->event->audit('event', 'comments marked read');
            $transaction->commit();
        } catch (\Exception $e) {
            $transaction->rollback();
            throw $e;
        }
    }