Embed Notice
HTML Code
Corresponding Notice
- Embed this notice@hypolite This sounds like coding with one hand tied on the back and then having the need to invent some workaround to counter the self caused limitations.
So the easy task of setting the status will now consist of:
- fetching all report fields (although we don't need the content for our task)
- fetching all associated side table fields (the uri-ids) (although this is of no interest here)
- processing the fields
- returning the content
- changing one value (the status)
- storing all fields in the report table
- delete all table entries for that report in the side table with the uri-ids
- insert all table entries again, although we haven't change anything there
And this process will even getting worse, when we have the need to set the status for a whole bunch of reports (when for example 10 people report the same, then we should be able to easily close 9 reports). In that case - instead of issuing a single update command with the array of the report ids - we had to execute the above steps in some loop. This will slow down the whole process and will increase the database load as well.
I understand the reason why to work with class variables instead of associated arrays when handling with fetched data. But I don't see a reason why to limit ourselves upon updating as well.