public static function create_from_field($field) {
        $event = self::create(array(
            'objectid' => $field->id,
            'context' => \context_system::instance(),
            'other' => array(
                'shortname' => $field->shortname,
                'name'      => $field->name,
                'datatype'  => $field->datatype,
            )
        ));

        $event->add_record_snapshot('user_info_field', $field);

        return $event;
    }
public static function create_from_field($field) {
        $event = self::create(array(
            'objectid' => $field->id,
            'context' => \context_system::instance(),
            'other' => array(
                'shortname' => $field->shortname,
                'name'      => $field->name,
                'datatype'  => $field->datatype,
            )
        ));

        $event->add_record_snapshot('user_info_field', $field);

        return $event;
    }
public static function create_from_field ( $ field ) { $ event = self :: create ( array ( 'objectid' => $ field -> id , 'context' => \ context_system :: instance ( ) , 'other' => array ( 'shortname' => $ field -> shortname , 'name' => $ field -> name , 'datatype' => $ field -> datatype , ) ) ) ; $ event -> add_record_snapshot ( 'user_info_field' , $ field ) ; return $ event ; }
Creates an event from a profile field.

@since Moodle 3.4
@param \stdClass $field A snapshot of the deleted field.
@return \core\event\base
Creates an event from a profile field .