Welcome Guest, Not a member yet? Register   Sign In
Entity fields not saving when using 'business logic' method.
#4

(This post was last modified: 01-26-2020, 04:47 AM by jreklund.)

I'm afraid that part of the userguide are incorrect. You can see a working example in @janroz post. Or setCreatedAt() in the userguide. It have been fixed and the userguide will be updated, in around a months time. When we aim to have the stable version out. Until then, please report all inconsistencies with the manual as you get kind of blind reading them yourself.

I haven't debugged this, so take as a grain of salt; The reason it's not working are that $this->password will call the magic __set function. And that function will go into setPassword() and the attribute will be emptied. $this->password sets the property of class itself (so that's why it's visible), but Codeigniter 4 queries are done based on the $this->attributes array.
Reply


Messages In This Thread
RE: Entity fields not saving when using 'business logic' method. - by jreklund - 01-26-2020, 04:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB