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

Breadcrumb

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

function FieldItemBase::__set

Overrides FieldItemInterface::__set

1 method overrides FieldItemBase::__set()
MapItem::__set in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/MapItem.php
Magic method: Sets a property value.

File

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

Class

FieldItemBase
An entity field item.

Namespace

Drupal\Core\Field

Code

public function __set($name, $value) {
    // Support setting values via property objects, but take care in as the
    // value of the 'entity' property is typed data also.
    if ($value instanceof TypedDataInterface && !$value instanceof EntityInterface) {
        $value = $value->getValue();
    }
    $this->set($name, $value);
}

API Navigation

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