Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72779

Set more than one value on a persistent at the same time

XMLWordPrintable

      It would be nice to have some new method in the persistents API that allow us to set more than one value on the persistent at the same time. For example we usually have to do something like this to set several values:

       

      $programuser->set('status', $validateddata->status);
      $programuser->set('startdatelocked', $validateddata->startdatelocked);
      $programuser->set('startdate', $validateddata->startdate);
      $programuser->set('duedatelocked', $validateddata->duedatelocked);
      $programuser->set('duedate', $validateddata->duedate);
      $programuser->set('enddatelocked', $validateddata->enddatelocked);
      $programuser->set('enddate', $validateddata->enddate);
      $programuser->update();

       

      Having some method like this one to pass an array of values would work:

      $programuser->set_many((array) $validateddata)->update();

       

            pholden Paul Holden
            davidcarrillo David Carrillo
            David Carrillo David Carrillo
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 51 minutes
                51m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.