Welcome Guest, Not a member yet? Register   Sign In
Cancel $model->save($data) operation using $beforeInsert
#7

Thank you for your answer, but this i not exactly the problem ;-)

The problem is that each token has a unique ID (primary key). The "token" is a public string given to the user, and it can change. Unlike the ID, which never changes, and which is not secured enough (as the user could guess all combinations by trying 1, 2, 3...).

So I wanted to perform the exact same thing you say, but based on another data. And without giving/knowing the primary key. 

I did it "easily" inside the controller (by checking before updating). But I wanted to take full advantages of models, and keep the controller very simple. That is how I ended up trying to do this in $beforeInsert.

Thanks anyway :-)
Reply


Messages In This Thread
RE: Cancel $model->save($data) operation using $beforeInsert - by littlej - 01-13-2020, 09:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB