CodeIgniter Forums
Entity allowed fields/attributes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Entity allowed fields/attributes (/showthread.php?tid=86968)



Entity allowed fields/attributes - [email protected] - 03-01-2023

Hi. Please help me on how to make entity.
Lets say i have user entity, then i have an array of name, address, email. Is there a way to make only allowed fields/attributes (lets say only name and email) will be filled when passing that array.
Maybe similiar to allowedFields on model feature.


RE: Entity allowed fields/attributes - luckmoshy - 03-02-2023

refer here https://codeigniter.com/user_guide/models/entities.html?highlight=entity


RE: Entity allowed fields/attributes - Emmajames14 - 03-02-2023

I want to know too


RE: Entity allowed fields/attributes - [email protected] - 03-02-2023

(03-02-2023, 01:09 AM)luckmoshy Wrote: refer hereĀ  https://codeigniter.com/user_guide/models/entities.html?highlight=entity

Thanks. But is there a way provided by CI for example to use method fill but discards non matching property in the array passed.