File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
src/Symfony/Component/Form Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ public function getPropertyPath()
194
194
return null ;
195
195
}
196
196
197
- if ($ this ->hasParent () && null === $ this ->getParent () ->getConfig ()->getDataClass ()) {
197
+ if ($ this ->parent && null === $ this ->parent ->getConfig ()->getDataClass ()) {
198
198
return new PropertyPath ('[ ' . $ this ->getName () . '] ' );
199
199
}
200
200
@@ -271,7 +271,12 @@ public function getParent()
271
271
}
272
272
273
273
/**
274
- * {@inheritdoc}
274
+ * Returns whether the form has a parent.
275
+ *
276
+ * @return Boolean
277
+ *
278
+ * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
279
+ * {@link getParent()} or inverse {@link isRoot()} instead.
275
280
*/
276
281
public function hasParent ()
277
282
{
@@ -291,7 +296,7 @@ public function getRoot()
291
296
*/
292
297
public function isRoot ()
293
298
{
294
- return ! $ this ->hasParent () ;
299
+ return null === $ this ->parent ;
295
300
}
296
301
297
302
/**
Original file line number Diff line number Diff line change @@ -38,13 +38,6 @@ public function setParent(FormInterface $parent = null);
38
38
*/
39
39
public function getParent ();
40
40
41
- /**
42
- * Returns whether the form has a parent.
43
- *
44
- * @return Boolean
45
- */
46
- public function hasParent ();
47
-
48
41
/**
49
42
* Adds a child to the form.
50
43
*
You can’t perform that action at this time.
0 commit comments