【发布时间】:2016-10-11 23:00:15
【问题描述】:
我没有找到任何关于此的信息。
我的问题是:
在 Symfony 表单上调用 ->createView() 后,它只是暂时清除我的实体对象。
即使我尝试将 find on 教义称为它,它也会返回给我一个空实体。
我填写表格并提交。
如果我在 createView 方法之前调用此脚本,它可以工作
dump(
$this->getDoctrine()->getManager()->getRepository(Address::class)->find(20)
);exit;
它输出给我:
Address {#1362 ▼
-id: 20
-city: City {#1382 ▶}
-cep: "*******"
-neighborhood: "*****"
-streetName: "*******"
-number: "******"
-complement: null
-type: "prefecture"
}
如果我这样做在 createView()
Address {#1414 ▼
+__isInitialized__: false
-id: 20
-city: null
-cep: null
-neighborhood: null
-streetName: null
-number: null
-complement: null
-type: null
…2
}
我正在使用 Symfony 3
【问题讨论】:
标签: php doctrine-orm symfony symfony-forms