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

Add a update or create function to persistent

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3
    • 3.3
    • Database SQL/XMLDB

    Description

      This came up in the dev chat, and I (and other it seems) think it would be good to have a save() (or maybe create_or_update(), but save() had the most votes in the chat) function on persistent that would create if the record has no id, and updates if it does.

      This is a very common task to do, and it seems silly to not roll it together into the core object.

      Attachments

        Activity

          People

            emerrill Eric Merrill
            emerrill Eric Merrill
            Mark Nelson Mark Nelson
            David Monllaó David Monllaó
            CiBoT CiBoT
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/May/17