Some methods in \Joomla\CMS\Table\Table could return more useful values.
For example "store", "save" and "delete" simply return hard-coded values of "true".
This doesn't indicate anything useful.
Return
`$this->_db->getAffectedRows() == 1`
probably via a saved value, so that any subsequent "after" events contribute rather than wipe out this result.
This confirms that the requested action did what was requested, not simply that it didn't cause a fatal error, which is already obvious.
Are there other methods ("reorder", for example) which could valuably be similarly changed?
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
?
|
Yes, point taken.
I think I'd rather get some information that I can decide the validity of rather than no information, but I can see that this case might not be convincing enough.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-05-06 21:04:54 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
Feature
Removed: ? |
I don't see the usecase here. We work in the direction that we throw execptions when something goes wrong. When an action goes well you get true, or an array of results or you can get the affected rows. So nothing to add if you ask me. Closing it.
@MarkRS-UK For the store and the save method your example makes sense because we know how many records we want to save. But for the delete method it is not always clear. We might run a delete statement regardless if the records with that PK exist or not, and of some of them don't exist it is not really an error.