创建视图后,Symfony清除实体对象

I didn't find anything about this.

My problem is:

After I call ->createView() on Symfony form, it just temporally clear my entity object.

And even if I try to call the find on doctrine it returns to me an empty entity.

I fill the form and submit.

if I call this script before the createView method, it works

dump(
        $this->getDoctrine()->getManager()->getRepository(Address::class)->find(20)
    );exit;

It outputs to me:

Address {#1362 ▼
  -id: 20
  -city: City {#1382 ▶}
  -cep: "*******"
  -neighborhood: "*****"
  -streetName: "*******"
  -number: "******"
  -complement: null
  -type: "prefecture"
}

If I do this after the createView()

Address {#1414 ▼
  +__isInitialized__: false
  -id: 20
  -city: null
  -cep: null
  -neighborhood: null
  -streetName: null
  -number: null
  -complement: null
  -type: null
   …2
}

I'm using Symfony 3

That's likely a proxy class. Try calling the actual getters, e.g.:

dump($entity->getStreetName());