Entity fields not saving when using 'business logic' method. |
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. |
Welcome Guest, Not a member yet? Register Sign In |