You are here

public static function LinkItem::mainPropertyName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/link/src/Plugin/Field/FieldType/LinkItem.php \Drupal\link\Plugin\Field\FieldType\LinkItem::mainPropertyName()

Returns the name of the main property, if any.

Some field items consist mainly of one main property, e.g. the value of a text field or the

target_id;

of an entity reference. If the field item has no main property, the method returns NULL.

Return value

string|null The name of the value property, or NULL if there is none.

Overrides FieldItemBase::mainPropertyName

See also

\Drupal\Core\Field\BaseFieldDefinition

File

core/modules/link/src/Plugin/Field/FieldType/LinkItem.php, line 169
Contains \Drupal\link\Plugin\Field\FieldType\LinkItem.

Class

LinkItem
Plugin implementation of the 'link' field type.

Namespace

Drupal\link\Plugin\Field\FieldType

Code

public static function mainPropertyName() {
  return 'uri';
}