Welcome Guest, Not a member yet? Register   Sign In
A check if model has anything to update
#3

(This post was last modified: 04-17-2022, 09:37 PM by rmilecki.)

(04-17-2022, 06:09 PM)kenjis Wrote: $allowedFields has only name, and name is not changed.
So There is no data to update.
You misunderstood me. I understand what and why happens. I'm looking for a solution.
  1. Entity doesn't know about $allowedFields so its ::hasChanged() is unreliable for this case
  2. Model doesn't have anything like ::hasChanged($entity)
It means that current there is no way to check if save() will have anything to update OR not (& will throw an exception).
Reply


Messages In This Thread
RE: A check if model has anything to update - by rmilecki - 04-17-2022, 09:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB