original_string: public function get_instance_data_for_backup(int $instanceid) : array {
          $finalfields = [];
          $data = $this->get_instance_data($instanceid, true);
          foreach ($data as $d) {
              if ($d->get('id') && $this->can_backup($d->get_field(), $instanceid)) {
                  $finalfields[] = [
                      'id' => $d->get('id'),
                      'shortname' => $d->get_field()->get('shortname'),
                      'type' => $d->get_field()->get('type'),
                      'value' => $d->get_value(),
                      'valueformat' => $d->get('valueformat')];
              }
          }
          return $finalfields;
      }
code: public function get_instance_data_for_backup(int $instanceid) : array {
          $finalfields = [];
          $data = $this->get_instance_data($instanceid, true);
          foreach ($data as $d) {
              if ($d->get('id') && $this->can_backup($d->get_field(), $instanceid)) {
                  $finalfields[] = [
                      'id' => $d->get('id'),
                      'shortname' => $d->get_field()->get('shortname'),
                      'type' => $d->get_field()->get('type'),
                      'value' => $d->get_value(),
                      'valueformat' => $d->get('valueformat')];
              }
          }
          return $finalfields;
      }
code_tokens: public function get_instance_data_for_backup ( int $ instanceid ) : array { $ finalfields = [ ] ; $ data = $ this -> get_instance_data ( $ instanceid , true ) ; foreach ( $ data as $ d ) { if ( $ d -> get ( 'id' ) && $ this -> can_backup ( $ d -> get_field ( ) , $ instanceid ) ) { $ finalfields [ ] = [ 'id' => $ d -> get ( 'id' ) , 'shortname' => $ d -> get_field ( ) -> get ( 'shortname' ) , 'type' => $ d -> get_field ( ) -> get ( 'type' ) , 'value' => $ d -> get_value ( ) , 'valueformat' => $ d -> get ( 'valueformat' ) ] ; } } return $ finalfields ; }
docstring: Get raw data associated with all fields current user can view or edit
  
  @param int $instanceid
  @return array
docstring_tokens: Get raw data associated with all fields current user can view or edit