You are here

public function RevisionItem::applyDefaultValue in Multiversion 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/RevisionItem.php \Drupal\multiversion\Plugin\Field\FieldType\RevisionItem::applyDefaultValue()

Applies the default value.

Parameters

bool $notify: (optional) Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again.

Return value

$this Returns itself to allow for chaining.

Overrides Map::applyDefaultValue

File

src/Plugin/Field/FieldType/RevisionItem.php, line 73

Class

RevisionItem
Plugin annotation @FieldType( id = "revision_token", label = @Translation("Revision token"), description = @Translation("Entity revision token."), no_ui = TRUE )

Namespace

Drupal\multiversion\Plugin\Field\FieldType

Code

public function applyDefaultValue($notify = TRUE) {
  $this
    ->setValue([
    'value' => '0-00000000000000000000000000000000',
    'new_edit' => TRUE,
    'revisions' => [],
    // We don't have an opinion on the default value and will leave that up
    // to the logic in the property class to decide.
    // @see \Drupal\multiversion\IsStub::getValue()
    'is_stub' => NULL,
  ], $notify);
  return $this;
}