```
$EntityName = 'App\\Entity\\' . ucwords($slug);
$item = new $EntityName();    
$item= $this->getDoctrine()->getRepository($EntityName)->find($id);
    $form = $this->createFormBuilder($item)

```

content of `$item`:

```
object(App\Entity\Members)#4788 (6) {
  ["id":"App\Entity\Members":private]=>
  int(9)
  ["username":"App\Entity\Members":private]=>
  string(13) "123"
  ["plainPassword":"App\Entity\Members":private]=>
  NULL
  ["password":"App\Entity\Members":private]=>
  string(0) ""
  ["email":"App\Entity\Members":private]=>
  string(7) "1@12.sw"
  ["isActive":"App\Entity\Members":private]=>
  bool(true)
}

```

I try to get the fields from $item.

As an output I want to have

```
id
username
password
email
isActive

```

to create the fields.

My approach is:

```
foreach($item as $field){
   echo $field;
}

```

But I do not get any output