Reputation: 971
I have object with relation, and want save it, but I have only id and don't want get object from database.
When I persist, I have this error:
Warning: spl_object_hash() expects parameter 1 to be object, integer given
I think need use DataTransformers? Сan someone tell me how to use it?
Upvotes: 2
Views: 2695
Reputation: 12717
Use EntityManager::getReference($entityName, $id)
to get a reference to the related record.
Read the getReference doc.
Upvotes: 4