Welcome Guest, Not a member yet? Register   Sign In
Datamap and insert/update
#1

It seems that the datamap array defined in the Entity class is ignored during data insert or update.

Whenever an entity attribute (table column) is set, the __set magic method calls the protected mapProperty method that translates the db column name to class column name.
However, when the data is being saved using the Model class, the mapped class columns are not replaced with the db columns.

The public toArray() method in the Entity class returns an array of both db and class names of the entity. Unfortunately, the entity's datamap is protected, so it's not possible to remove the class names by keys right before data insert.

I'd like to use the datamap and be able to insert/update rows in the database. Of course it's possible that I'm missing something here. Any help would be appreciated.
Reply


Messages In This Thread
Datamap and insert/update - by Navindex - 04-04-2020, 04:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB