Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1116

Allow restricting "kDBItem::Update" method to given fields only

    XMLWordPrintable

    Details

    • Change Log Message:
      Adds ability to update specific db fields only
    • Story Points:
      1
    • External issue ID:
      1355
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

    • BC Break Details:
      Hide

      Signature of "kDBItem::Update" was changed (parameter "$update_fields" was added between 2 existing parameters) and therefore any call with 2 parameters would now not work as expected.

      Show
      Signature of "kDBItem::Update" was changed (parameter "$update_fields" was added between 2 existing parameters) and therefore any call with 2 parameters would now not work as expected.

      Description

      Right now, when some fields of kDBItem object are changed and kDBItem::Update method is issued then all fields are put into UPDATE sql and not only ones, that were changed.

      I'm proposing to add 2nd optional parameter (1st parameter is $id) to kDBItem::Update method to allow specifying fields, that should only be updated in database. Also only these fields will be overwritten in kDBItem::OriginalFieldValues array.
      This way there is still way to detect change in field values, that were not specified to kDBItem::Update method.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: