Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FieldItemBase.php

function FieldItemBase::__unset

Overrides FieldItemInterface::__unset

File

core/lib/Drupal/Core/Field/FieldItemBase.php, line 186

Class

FieldItemBase
An entity field item.

Namespace

Drupal\Core\Field

Code

public function __unset($name) {
    if ($this->definition
        ->getPropertyDefinition($name)) {
        $this->set($name, NULL);
    }
    else {
        // Explicitly unset the property in $this->values if a non-defined
        // property is unset, such that its key is removed from $this->values.
        unset($this->values[$name]);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal