Skip to content
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

Remove public access for getFieldValue #6716

Merged
merged 1 commit into from
Jan 1, 2021
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
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADE-3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ UPGRADE 3.x
UPGRADE FROM 3.xx to 3.xx
=========================

### Deprecated `FieldDescriptionInterface::getFieldValue()`

`BaseFieldDescription::getFieldValue()` will become protected.

### `RouteCollection` now implements `RouteCollectionInterface`

In 4.0, `AbstractAdmin::configureRoutes` and `AdminExtensionInterface::configureRoutes` will receive a
Expand Down
10 changes: 10 additions & 0 deletions src/Admin/BaseFieldDescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,16 @@ public function hasAssociationAdmin()
return null !== $this->associationAdmin;
}

/**
* NEXT_MAJOR: Change the visibility to protected.
*
* @param object|null $object
* @param string $fieldName
*
* @throws NoValueException
*
* @return mixed
*/
public function getFieldValue($object, $fieldName)
{
if ($this->isVirtual() || null === $object) {
Expand Down
10 changes: 9 additions & 1 deletion src/Admin/FieldDescriptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace Sonata\AdminBundle\Admin;

use Sonata\AdminBundle\Exception\NoValueException;

/**
* @author Thomas Rabaix <[email protected]>
*
Expand Down Expand Up @@ -228,7 +230,9 @@ public function isIdentifier();
*
* @param object $object
*
* @return bool|mixed
* @throws NoValueException if the value cannot be determined
*
* @return mixed
*/
public function getValue($object);

Expand Down Expand Up @@ -314,6 +318,10 @@ public function getSortFieldMapping();
public function getSortParentAssociationMapping();

/**
* NEXT_MAJOR: Remove this method from the interface.
*
* @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0.
*
* @param object|null $object
* @param string $fieldName
*
Expand Down