protected function validate_item($item) {

        $allowed = array(
            'user'              => true,
            'grouping'          => true,
            'group'             => true,
            'role'              => true,
            'file'              => true,
            'scale'             => true,
            'outcome'           => true,
            'grade_item'        => true,
            'question_category' => true
        );

        if (!isset($allowed[$item])) {
            throw new coding_exception('Invalid inforef item type');
        }
    }
protected function validate_item($item) {

        $allowed = array(
            'user'              => true,
            'grouping'          => true,
            'group'             => true,
            'role'              => true,
            'file'              => true,
            'scale'             => true,
            'outcome'           => true,
            'grade_item'        => true,
            'question_category' => true
        );

        if (!isset($allowed[$item])) {
            throw new coding_exception('Invalid inforef item type');
        }
    }
protected function validate_item ( $ item ) { $ allowed = array ( 'user' => true , 'grouping' => true , 'group' => true , 'role' => true , 'file' => true , 'scale' => true , 'outcome' => true , 'grade_item' => true , 'question_category' => true ) ; if ( ! isset ( $ allowed [ $ item ] ) ) { throw new coding_exception ( 'Invalid inforef item type' ) ; } }
Makes sure that the given name is a valid citizen of inforef.xml file

@see backup_helper::get_inforef_itemnames()
@param string $item the name of reference (like user, file, scale, outcome or grade_item)
@throws coding_exception
Makes sure that the given name is a valid citizen of inforef . xml file