public function get_comment_object() {
        global $CFG;
        require_once($CFG->dirroot . '/comment/lib.php');

        if (!$this->get('id')) {
            throw new \coding_exception('The plan must exist.');
        }

        $comment = new comment((object) array(
            'client_id' => 'plancommentarea' . $this->get('id'),
            'context' => $this->get_context(),
            'component' => 'competency',    // This cannot be named 'core_competency'.
            'itemid' => $this->get('id'),
            'area' => 'plan',
            'showcount' => true,
        ));
        $comment->set_fullwidth(true);
        return $comment;
    }