• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Datamap and insert/update

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.