public static function instance_from_object(stdClass $data) {
        $i = new self();

        if (!isset($data->numofreviews)) {
            throw new coding_exception('Missing value of the numofreviews property');
        } else {
            $i->numofreviews = (int)$data->numofreviews;
        }

        if (!isset($data->numper)) {
            throw new coding_exception('Missing value of the numper property');
        } else {
            $i->numper = (int)$data->numper;
            if ($i->numper !== self::NUMPER_SUBMISSION and $i->numper !== self::NUMPER_REVIEWER) {
                throw new coding_exception('Invalid value of the numper property');
            }
        }

        foreach (array('excludesamegroup', 'removecurrent', 'assesswosubmission', 'addselfassessment') as $k) {
            if (isset($data->$k)) {
                $i->$k = (bool)$data->$k;
            } else {
                $i->$k = false;
            }
        }

        return $i;
    }
public static function instance_from_object(stdClass $data) {
        $i = new self();

        if (!isset($data->numofreviews)) {
            throw new coding_exception('Missing value of the numofreviews property');
        } else {
            $i->numofreviews = (int)$data->numofreviews;
        }

        if (!isset($data->numper)) {
            throw new coding_exception('Missing value of the numper property');
        } else {
            $i->numper = (int)$data->numper;
            if ($i->numper !== self::NUMPER_SUBMISSION and $i->numper !== self::NUMPER_REVIEWER) {
                throw new coding_exception('Invalid value of the numper property');
            }
        }

        foreach (array('excludesamegroup', 'removecurrent', 'assesswosubmission', 'addselfassessment') as $k) {
            if (isset($data->$k)) {
                $i->$k = (bool)$data->$k;
            } else {
                $i->$k = false;
            }
        }

        return $i;
    }
public static function instance_from_object ( stdClass $ data ) { $ i = new self ( ) ; if ( ! isset ( $ data -> numofreviews ) ) { throw new coding_exception ( 'Missing value of the numofreviews property' ) ; } else { $ i -> numofreviews = ( int ) $ data -> numofreviews ; } if ( ! isset ( $ data -> numper ) ) { throw new coding_exception ( 'Missing value of the numper property' ) ; } else { $ i -> numper = ( int ) $ data -> numper ; if ( $ i -> numper !== self :: NUMPER_SUBMISSION and $ i -> numper !== self :: NUMPER_REVIEWER ) { throw new coding_exception ( 'Invalid value of the numper property' ) ; } } foreach ( array ( 'excludesamegroup' , 'removecurrent' , 'assesswosubmission' , 'addselfassessment' ) as $ k ) { if ( isset ( $ data -> $ k ) ) { $ i -> $ k = ( bool ) $ data -> $ k ; } else { $ i -> $ k = false ; } } return $ i ; }
Factory method making the instance from data in the passed object

@param stdClass $data an object holding the values for our public properties
@return workshop_random_allocator_setting
Factory method making the instance from data in the passed object