fix #86

PHP Catchable fatal error: Object of class converted to string - foreign
key assigned object on update