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

Add a update or create function to persistent

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.3
    • Component/s: Database SQL/XMLDB
    • Labels:

      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

            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/17