summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-02-09 21:07:24 +0900
committerNathaniel Catchpole2016-02-09 21:07:24 +0900
commit805a22e9c342b3a4b3f383efbe9f1b78b8826bec (patch)
tree547fb952b1a53e4609d9bac4e1cac9c95d0b97da /core/modules/rest/src/Plugin/rest/resource/EntityResource.php
parentdcc5beda46af18eb1481a6e6adb4f3df638ba57a (diff)
Issue #2418587 by xjm, marthinal, AjitS, Wim Leers, neilmc, Berdir: Set entity values to NULL instead of using unset() method: unset() is misleading
Diffstat (limited to 'core/modules/rest/src/Plugin/rest/resource/EntityResource.php')
-rw-r--r--core/modules/rest/src/Plugin/rest/resource/EntityResource.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
index 34b0bda..d906417 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -50,7 +50,7 @@ class EntityResource extends ResourceBase {
}
foreach ($entity as $field_name => $field) {
if (!$field->access('view')) {
- unset($entity->{$field_name});
+ $entity->set($field_name, NULL);
}
}