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?
Use
EntityManager::getReference($entityName, $id)to get a reference to the related record.Read the getReference doc.