Update uses new values in the Where selection
Reported by Kris Jordan | April 9th, 2009 @ 11:01 AM | in 0.30
Luiz: i have a A_x_B_x_C model where A, B and C are PKs 2 points here: 1. Recess doent allows me declare "!Column PrimaryKey" to A_id, B_id, C_id at the same time Sent at 10:14 AM on Thursday Luiz: 2. If i try to update an instance of A_x_B_x_C the update query is wrong, because it uses the NEW values int the WHERE clause Look: $abc->a_id = 1; $abc->b_id = 2; $abc->c_id = 3; $abc->exists(); $abc->a_id = 5; $abc->save(); what i expected: UPDATE A_x_B_C SET a_id = 5 WHERE a_id = 1 AND b_id = 1 AND c_id = 2; what i got: UPDATE A_x_B_C SET a_id = 5 WHERE a_id = 5 AND b_id = 1 AND c_id = 2; i think we need store key values in a private var on model object named like: $originalValues; and use the $originalValues for WHERE clause do you agree?
Comments and changes to this ticket
-
Kris Jordan June 9th, 2009 @ 02:10 PM
- State changed from new to open
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
The Recess PHP Framework is an open source, full stack, RESTful PHP framework.
http://www.recessframework.org/