original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Creates an event from a profile field.
  
  @since Moodle 3.4
  @param \stdClass $field A snapshot of the deleted field.
  @return \core\event\base
docstring_tokens: Creates an event from a profile field .