original_string: protected static function export_data_content($context, $recordobj, $fieldobj, $contentobj) {
          $value = (object)[
              'field' => [
                  // Name and description are displayed in mod_data without applying format_string().
                  'name' => $fieldobj->name,
                  'description' => $fieldobj->description,
                  'type' => $fieldobj->type,
                  'required' => transform::yesno($fieldobj->required),
              ],
              'content' => $contentobj->content
          ];
          foreach (['content1', 'content2', 'content3', 'content4'] as $key) {
              if ($contentobj->$key !== null) {
                  $value->$key = $contentobj->$key;
              }
          }
          $classname = manager::get_provider_classname_for_component('datafield_' . $fieldobj->type);
          if (class_exists($classname) && is_subclass_of($classname, datafield_provider::class)) {
              component_class_callback($classname, 'export_data_content',
                  [$context, $recordobj, $fieldobj, $contentobj, $value]);
          } else {
              // Data field plugin does not implement datafield_provider, just export default value.
              writer::with_context($context)->export_data([$recordobj->id, $contentobj->id], $value);
          }
          writer::with_context($context)->export_area_files([$recordobj->id, $contentobj->id], 'mod_data',
              'content', $contentobj->id);
      }
code: protected static function export_data_content($context, $recordobj, $fieldobj, $contentobj) {
          $value = (object)[
              'field' => [
                  // Name and description are displayed in mod_data without applying format_string().
                  'name' => $fieldobj->name,
                  'description' => $fieldobj->description,
                  'type' => $fieldobj->type,
                  'required' => transform::yesno($fieldobj->required),
              ],
              'content' => $contentobj->content
          ];
          foreach (['content1', 'content2', 'content3', 'content4'] as $key) {
              if ($contentobj->$key !== null) {
                  $value->$key = $contentobj->$key;
              }
          }
          $classname = manager::get_provider_classname_for_component('datafield_' . $fieldobj->type);
          if (class_exists($classname) && is_subclass_of($classname, datafield_provider::class)) {
              component_class_callback($classname, 'export_data_content',
                  [$context, $recordobj, $fieldobj, $contentobj, $value]);
          } else {
              // Data field plugin does not implement datafield_provider, just export default value.
              writer::with_context($context)->export_data([$recordobj->id, $contentobj->id], $value);
          }
          writer::with_context($context)->export_area_files([$recordobj->id, $contentobj->id], 'mod_data',
              'content', $contentobj->id);
      }
code_tokens: protected static function export_data_content ( $ context , $ recordobj , $ fieldobj , $ contentobj ) { $ value = ( object ) [ 'field' => [ // Name and description are displayed in mod_data without applying format_string(). 'name' => $ fieldobj -> name , 'description' => $ fieldobj -> description , 'type' => $ fieldobj -> type , 'required' => transform :: yesno ( $ fieldobj -> required ) , ] , 'content' => $ contentobj -> content ] ; foreach ( [ 'content1' , 'content2' , 'content3' , 'content4' ] as $ key ) { if ( $ contentobj -> $ key !== null ) { $ value -> $ key = $ contentobj -> $ key ; } } $ classname = manager :: get_provider_classname_for_component ( 'datafield_' . $ fieldobj -> type ) ; if ( class_exists ( $ classname ) && is_subclass_of ( $ classname , datafield_provider :: class ) ) { component_class_callback ( $ classname , 'export_data_content' , [ $ context , $ recordobj , $ fieldobj , $ contentobj , $ value ] ) ; } else { // Data field plugin does not implement datafield_provider, just export default value. writer :: with_context ( $ context ) -> export_data ( [ $ recordobj -> id , $ contentobj -> id ] , $ value ) ; } writer :: with_context ( $ context ) -> export_area_files ( [ $ recordobj -> id , $ contentobj -> id ] , 'mod_data' , 'content' , $ contentobj -> id ) ; }
docstring: Export one field answer in a record in database activity module
  
  @param \context $context
  @param \stdClass $recordobj record from DB table {data_records}
  @param \stdClass $fieldobj record from DB table {data_fields}
  @param \stdClass $contentobj record from DB table {data_content}
docstring_tokens: Export one field answer in a record in database activity module