public function get_competencies() {
        $competencies = array();

        if ($this->get('status') == self::STATUS_COMPLETE) {
            // Get the competencies from the archive of the plan.
            $competencies = user_competency_plan::list_competencies($this->get('id'), $this->get('userid'));
        } else if ($this->is_based_on_template()) {
            // Get the competencies from the template.
            $competencies = template_competency::list_competencies($this->get('templateid'));
        } else {
            // Get the competencies from the plan.
            $competencies = plan_competency::list_competencies($this->get('id'));
        }

        return $competencies;
    }