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
Im trying to understad how $this->classCastCache array works in Model class. There are only two places in HasAttributes trait where you can add value to this array.
So only !$caster instanceof CastsInboundAttributes && is_object($value) can be added to this array. If so then why are we checking for this $caster instanceof CastsInboundAttributes || ! is_object($value) to unset entry THAT HAS 0 CHANCE of existensce?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Im trying to understad how $this->classCastCache array works in Model class. There are only two places in HasAttributes trait where you can add value to this array.
here:
and here:
As you see in both functions there are this construction:
So only !$caster instanceof CastsInboundAttributes && is_object($value) can be added to this array. If so then why are we checking for this $caster instanceof CastsInboundAttributes || ! is_object($value) to unset entry THAT HAS 0 CHANCE of existensce?
Beta Was this translation helpful? Give feedback.
All reactions