Entity - allowedFields add functionality |
As per https://forum.codeigniter.com/forum-29.html
I thought by adding $allowedFields to an entity that an Entity would behave similar to a Model. (Indeed I thought that defining $attributes was the same thing as defining $allowedFields in the context of an Entity.)
Indeed I think from a design perspective that when defining an Entity as per my understanding: Quote:"At its core, an Entity class is simply a class that represents a single database row." Therefore when we are defining fields using $attributes in an Entity shouldn't we effectively be setting the $allowedFields of that database row? I think a good implementation would be to have $eligibleFields for Entities and $allowedFields for Models where if $allowedFields is not blank that it takes precedence. (Typically where an Entity is defined as the $returnType of a Model then that is the place for fields to defined rather than at the model level.) Whats are your thoughts? |
Messages In This Thread |
Entity - allowedFields add functionality - by maximusto - 08-29-2021, 06:19 PM
RE: Entity - allowedFields add functionality - by maximusto - 09-03-2021, 12:09 PM
|