Entity object attribute update problem |
Currently if i have JSON column `data` in the database and use Entity's i can not do this (i want to update a `role` property of `data` object of `user` entity):
PHP Code: $user->data->role = "user"; It says there is nothing to update I have to do this: PHP Code: $data = $user->data; Is there a better way to say Entity that some attribute has been updated?
Did you create a getUser and setUser methods in your Entity Class?
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(01-24-2023, 01:39 AM)kenjis Wrote: See https://codeigniter.com/user_guide/model...on-casting yes, the same technique in the docs PHP Code: $user = $userModel->find(15); ok PHP Code: class Jsonable PHP Code: class MyEntity extends Entity |
Welcome Guest, Not a member yet? Register Sign In |