如何使用JMS序列化程序上载文件?现在我得到Notice: Array to string conversion
App \ Entity \ Answer
/**
* @Type("string")
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $file;
App \ Controller \ AnswerController
$data = array_replace_recursive(
$request->request->all(),
$request->files->all()
);
$serializer = SerializerBuilder::create()->build();
$object = $serializer->deserialize(json_encode($data), Answer::class, 'json');
$em = $this->getDoctrine()->getManager();
$em->persist($object);
$em->flush();