Ferreteria/v0.5/@cls/data/card/k1i/cStor/DoUpdate

From Woozle Writes Code
< Ferreteria‎ | v0.5‎ | @cls
Jump to navigation Jump to search
Ferreteria: ferret\data\card\k1i\cStor::DoUpdate()
  • Code: data/fields/card/k1i/stor.php
  • Purpose: write modified values to disk storage (with any format-conversion handled automatically)
  • Input:
    • array $arVals: native-format values to be updated in storage
    • array $arLits: additional SQL terms to apply (e.g. NOW())

About

It turns out to be important to understand the nuances of this method. The "values" are in unquoted SQL-compatible format, and need to be quote-checked before saving. The literals, however, can be passed through directly.

History

when what
2023-03-24 Realized that this function (or at least this code) does not belong in the base (cK1I), so moved it to cStor.
2023-03-23 At first I thought this would need separate arguments for values and literals, but actually it should only be used to update data values because it will update memory if locked. Not sure this is good design. Maybe it should do both and then reload. What's the intent, here?
2023-02-26 changing from public to protected
2023-02-20 modified so if record is locked, this just updates the local data
2022-01-03 moved from cRecordKeyed to tStorageK1I
2019-11-26 creating DoUpdate() (and DoInsert()) as a way of transitioning to usage of status-object returns
2019-07-26 moved from fcRecord_keyed_single to fcRecord_keyed, because it should work as long as GetSelfFilter() is defined.
2019-06-11 removed 2nd parameter; massage data with $db->SanitizeValueArray() instead