Fairly new to Fuel PHP, we are using it as a backend for our iOS application. I'm running into a weird situation where I am updating the property of a User Model and the user_id is being overwritten by the user_id of the person that is logged in when I save that user.
We think it may be related to something with ORM or the relationships that we have set up but this is the only model that I am experiencing this with.
I can provide any code snippets as needed, just ask.
If anyone has any advice I would greatly appreciate it.
I can't comment on it being odd, you should ask the developer about why it was implemented like this. Observers are standard ORM functionality, and very useful if you want event driven actions on ORM objects.
Since Observer_Self is used, the model will have a before_insert() and before_update() method that will do the actual update. That might cause problems elsewhere if those methods do more than only the update of the user_id property.
Are you using the auth package? If so, there are some observers attached to the models one of them being a let's call it auditor observer. It will automatically update the column 'user_id' of any object so that you can keep track of who last updated that record.
Ah we are totally doing this wrong then. We have been using the user_id as a key for the user. I didn't realize that this column was who update the record, I guess it kind of makes sense. We'll just have to come up with some different name for the column or remove the observer.