8000 [Form] removed hasParent from FormInterface and deprecated its use by Tobion · Pull Request #5360 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] removed hasParent from FormInterface and deprecated its use #5360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading 10000
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/Symfony/Component/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function getPropertyPath()
return null;
}

if ($this->hasParent() && null === $this->getParent()->getConfig()->getDataClass()) {
if ($this->parent && null === $this->parent->getConfig()->getDataClass()) {
return new PropertyPath('[' . $this->getName() . ']');
}

Expand Down Expand Up @@ -271,7 +271,12 @@ public function getParent()
}

/**
* {@inheritdoc}
* Returns whether the form has a parent.
*
* @return Boolean
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
* {@link getParent()} or inverse {@link isRoot()} instead.
*/
public function hasParent()
{
Expand All @@ -291,7 +296,7 @@ public function getRoot()
*/
public function isRoot()
{
return !$this->hasParent();
return null === $this->parent;
}

/**
Expand Down
7 changes: 0 additions & 7 deletions src/Symfony/Component/Form/FormInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ public function setParent(FormInterface $parent = null);
*/
public function getParent();

/**
* Returns whether the form has a parent.
*
* @return Boolean
*/
public function hasParent();

/**
* Adds a child to the form.
*
Expand Down
0