@@ -100,7 +100,7 @@ creating that particular field is delegated to an event listener::
100
100
$builder->add('price');
101
101
102
102
$builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) {
103
- // adding the name field if needed
103
+ //... adding the name field if needed
104
104
});
105
105
}
106
106
@@ -121,9 +121,9 @@ the event listener might look like the following::
121
121
$form = $event->getForm();
122
122
123
123
// check if the Product object is "new"
124
- // Ifyou didn't pass any data to the form, the data is "null".
124
+ // Ifno data is passed to the form, the data is "null".
125
125
// This should be considered a new "Product"
126
- if (!$product ||! $product->getId()) {
126
+ if (!$product ||null !== $product->getId()) {
127
127
$form->add('name', 'text');
128
128
}
129
129
});
@@ -212,7 +212,7 @@ class::
212
212
$product = $event->getData();
213
213
$form = $event->getForm();
214
214
215
- if (!$product ||! $product->getId()) {
215
+ if (!$product ||null !== $product->getId()) {
216
216
$form->add('name', 'text');
217
217
}
218
218
}