original_string: public function get_competency($competencyid) {
          $competency = null;
  
          if ($this->get('status') == self::STATUS_COMPLETE) {
              // Get the competency from the archive of the plan.
              $competency = user_competency_plan::get_competency_by_planid($this->get('id'), $competencyid);
          } else if ($this->is_based_on_template()) {
              // Get the competency from the template.
              $competency = template_competency::get_competency($this->get('templateid'), $competencyid);
          } else {
              // Get the competency from the plan.
              $competency = plan_competency::get_competency($this->get('id'), $competencyid);
          }
          return $competency;
      }
code: public function get_competency($competencyid) {
          $competency = null;
  
          if ($this->get('status') == self::STATUS_COMPLETE) {
              // Get the competency from the archive of the plan.
              $competency = user_competency_plan::get_competency_by_planid($this->get('id'), $competencyid);
          } else if ($this->is_based_on_template()) {
              // Get the competency from the template.
              $competency = template_competency::get_competency($this->get('templateid'), $competencyid);
          } else {
              // Get the competency from the plan.
              $competency = plan_competency::get_competency($this->get('id'), $competencyid);
          }
          return $competency;
      }
code_tokens: public function get_competency ( $ competencyid ) { $ competency = null ; if ( $ this -> get ( 'status' ) == self :: STATUS_COMPLETE ) { // Get the competency from the archive of the plan. $ competency = user_competency_plan :: get_competency_by_planid ( $ this -> get ( 'id' ) , $ competencyid ) ; } else if ( $ this -> is_based_on_template ( ) ) { // Get the competency from the template. $ competency = template_competency :: get_competency ( $ this -> get ( 'templateid' ) , $ competencyid ) ; } else { // Get the competency from the plan. $ competency = plan_competency :: get_competency ( $ this -> get ( 'id' ) , $ competencyid ) ; } return $ competency ; }
docstring: Get a single competency from this plan.
  
  This will throw an exception if the competency does not belong to the plan.
  
  @param int $competencyid The competency ID.
  @return competency
docstring_tokens: Get a single competency from this plan .