36 $this->contextFactory = $context_factory;
42 public function id() {
50 $editable_contexts = $state->
getItemContext()->getAdditionalContext(
'editableContexts');
51 $state->
set(
'regenerate_contexts', $editable_contexts);
58 if ($is_editor_field) {
59 $regenerate_contexts = $state->
get(
'regenerate_contexts');
64 $entity = $items->getEntity();
65 $uuid = $entity->uuid();
67 if (!empty($regenerate_contexts[$uuid][$field_config_id])) {
68 $from_context = $this->contextFactory->get($regenerate_contexts[$uuid][$field_config_id]);
69 $context = $this->contextFactory->regenerate($from_context);
70 $data->
addModel(
'context', $from_context->getContextString(), [
71 'id' => $context->getContextString(),
73 'fieldId' => $field_config_id,
77 $context = $this->contextFactory->create($field_config_id, $entity->id());
78 $data->
addModel(
'context', $context->getContextString(), [
79 'id' => $context->getContextString(),
81 'fieldId' => $field_config_id,
82 'schemaId' => $field_config_id,
95 return $this->contextFactory->get($context_id);
static ensureFieldConfig(FieldDefinitionInterface $field_definition=NULL)
__construct(CommandContextFactoryInterface $context_factory)
processField(WidgetBinderData $data, WidgetBinderDataCompilerState $state, EntityReferenceFieldItemListInterface $items, $is_editor_field)
initialize(WidgetBinderData $data, WidgetBinderDataCompilerState $state, ParagraphInterface $root_paragraph)