You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicfunctionset_attribute(\DateTime$attribute) {
$time_stamp = $attribute->getTimestamp();
// Attribute in DB column expects an int type, not a DateTime$this->assign_attribute('attribute', $time_stamp);
}
The magic setter will be called during the magic creation but we get an error no matter what is passed in as the value. This is because if the value passed in is an int, the magic setter expects a DateTime. If the value passed in is a DateTime the mass assignment during the magic creation expects the type to be in parity with the table column (an int).
The text was updated successfully, but these errors were encountered:
When creating an
AbstractModel
via the several builder methods:The model expects the attribute to match the column type. Only issue with that is if we have a magic setter for a particular attribute:
The magic setter will be called during the magic creation but we get an error no matter what is passed in as the value. This is because if the value passed in is an
int
, the magic setter expects aDateTime
. If the value passed in is aDateTime
the mass assignment during the magic creation expects the type to be in parity with the table column (anint
).The text was updated successfully, but these errors were encountered: