TypeError when setting database column values using Model->set() #14
Labels
No labels
bug
dependency
documentation
feature
invalid
refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
vlw/scaffold#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Trying to set a database column value using the
vlw\Scaffold\Database\Model->set()method directly using property hooks in an inheriting class does set the value properly in the database, and the type checking is still working, but it also throws aTypeErrorsince the return type of theset()method is a boolean. It's possible that PHP is also trying to assign the return value to the virtual property itself, although I'm not sure about that.How to reproduce
Take this virtual property in a class that extends the
Modelabstract class for example:Setting it with:
DOES update the database properly, but also throws: