original_string: protected static function convert_fields(\stdClass $data) {
          $data = parent::convert_fields($data);
  
          if (!empty($data->lawfulbases) && is_array($data->lawfulbases)) {
              $data->lawfulbases = implode(',', $data->lawfulbases);
          }
          if (!empty($data->sensitivedatareasons) && is_array($data->sensitivedatareasons)) {
              $data->sensitivedatareasons = implode(',', $data->sensitivedatareasons);
          }
  
          // A single value.
          $data->retentionperiod = 'P' . $data->retentionperiodnumber . $data->retentionperiodunit;
          unset($data->retentionperiodnumber);
          unset($data->retentionperiodunit);
  
          return $data;
      }
code: protected static function convert_fields(\stdClass $data) {
          $data = parent::convert_fields($data);
  
          if (!empty($data->lawfulbases) && is_array($data->lawfulbases)) {
              $data->lawfulbases = implode(',', $data->lawfulbases);
          }
          if (!empty($data->sensitivedatareasons) && is_array($data->sensitivedatareasons)) {
              $data->sensitivedatareasons = implode(',', $data->sensitivedatareasons);
          }
  
          // A single value.
          $data->retentionperiod = 'P' . $data->retentionperiodnumber . $data->retentionperiodunit;
          unset($data->retentionperiodnumber);
          unset($data->retentionperiodunit);
  
          return $data;
      }
code_tokens: protected static function convert_fields ( \ stdClass $ data ) { $ data = parent :: convert_fields ( $ data ) ; if ( ! empty ( $ data -> lawfulbases ) && is_array ( $ data -> lawfulbases ) ) { $ data -> lawfulbases = implode ( ',' , $ data -> lawfulbases ) ; } if ( ! empty ( $ data -> sensitivedatareasons ) && is_array ( $ data -> sensitivedatareasons ) ) { $ data -> sensitivedatareasons = implode ( ',' , $ data -> sensitivedatareasons ) ; } // A single value. $ data -> retentionperiod = 'P' . $ data -> retentionperiodnumber . $ data -> retentionperiodunit ; unset ( $ data -> retentionperiodnumber ) ; unset ( $ data -> retentionperiodunit ) ; return $ data ; }
docstring: Converts data to data suitable for storage.
  
  @param \stdClass $data
  @return \stdClass
docstring_tokens: Converts data to data suitable for storage .