protected function validate_competencyframeworkid($value) {

        // During update.
        if ($this->get('id')) {

            // Ensure that we are not trying to move the competency across frameworks.
            if ($this->beforeupdate->get('competencyframeworkid') != $value) {
                return new lang_string('invaliddata', 'error');
            }

        } else {
            // During create.

            // Check that the framework exists.
            if (!competency_framework::record_exists($value)) {
                return new lang_string('invaliddata', 'error');
            }
        }

        return true;
    }
protected function validate_competencyframeworkid($value) {

        // During update.
        if ($this->get('id')) {

            // Ensure that we are not trying to move the competency across frameworks.
            if ($this->beforeupdate->get('competencyframeworkid') != $value) {
                return new lang_string('invaliddata', 'error');
            }

        } else {
            // During create.

            // Check that the framework exists.
            if (!competency_framework::record_exists($value)) {
                return new lang_string('invaliddata', 'error');
            }
        }

        return true;
    }
protected function validate_competencyframeworkid ( $ value ) { // During update. if ( $ this -> get ( 'id' ) ) { // Ensure that we are not trying to move the competency across frameworks. if ( $ this -> beforeupdate -> get ( 'competencyframeworkid' ) != $ value ) { return new lang_string ( 'invaliddata' , 'error' ) ; } } else { // During create. // Check that the framework exists. if ( ! competency_framework :: record_exists ( $ value ) ) { return new lang_string ( 'invaliddata' , 'error' ) ; } } return true ; }
Validate the competency framework ID.

@param int $value The framework ID.
@return true|lang_string
Validate the competency framework ID .