original_string: protected function validate_relatedcompetencyid($data) {
  
          if ($this->get('competencyid') == $data) {
              // A competency cannot be related to itself.
              return new lang_string('invaliddata', 'error');
  
          } if ($this->get('competencyid') > $data) {
              // The competency ID must be lower than the related competency ID.
              return new lang_string('invaliddata', 'error');
  
          } else if (!competency::record_exists($data)) {
              return new lang_string('invaliddata', 'error');
  
          } else if (!competency::share_same_framework(array($data, $this->get('competencyid')))) {
              // The competencies must belong to the same framework.
              return new lang_string('invaliddata', 'error');
          }
  
          return true;
      }
code: protected function validate_relatedcompetencyid($data) {
  
          if ($this->get('competencyid') == $data) {
              // A competency cannot be related to itself.
              return new lang_string('invaliddata', 'error');
  
          } if ($this->get('competencyid') > $data) {
              // The competency ID must be lower than the related competency ID.
              return new lang_string('invaliddata', 'error');
  
          } else if (!competency::record_exists($data)) {
              return new lang_string('invaliddata', 'error');
  
          } else if (!competency::share_same_framework(array($data, $this->get('competencyid')))) {
              // The competencies must belong to the same framework.
              return new lang_string('invaliddata', 'error');
          }
  
          return true;
      }
code_tokens: protected function validate_relatedcompetencyid ( $ data ) { if ( $ this -> get ( 'competencyid' ) == $ data ) { // A competency cannot be related to itself. return new lang_string ( 'invaliddata' , 'error' ) ; } if ( $ this -> get ( 'competencyid' ) > $ data ) { // The competency ID must be lower than the related competency ID. return new lang_string ( 'invaliddata' , 'error' ) ; } else if ( ! competency :: record_exists ( $ data ) ) { return new lang_string ( 'invaliddata' , 'error' ) ; } else if ( ! competency :: share_same_framework ( array ( $ data , $ this -> get ( 'competencyid' ) ) ) ) { // The competencies must belong to the same framework. return new lang_string ( 'invaliddata' , 'error' ) ; } return true ; }
docstring: Validate related competency ID.
  
  @param int $data The related competency ID.
  @return true|lang_string
docstring_tokens: Validate related competency ID .