Drupal 8  8.0.2
QuickEditFieldForm Class Reference
Inheritance diagram for QuickEditFieldForm:

Public Member Functions

 __construct (PrivateTempStoreFactory $temp_store_factory, ModuleHandlerInterface $module_handler, EntityStorageInterface $node_type_storage, ValidatorInterface $validator)
 
 getFormId ()
 
 buildForm (array $form, FormStateInterface $form_state, EntityInterface $entity=NULL, $field_name=NULL)
 
 validateForm (array &$form, FormStateInterface $form_state)
 
 submitForm (array &$form, FormStateInterface $form_state)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Member Functions

 init (FormStateInterface $form_state, EntityInterface $entity, $field_name)
 
 simplify (array &$form, FormStateInterface $form_state)
 

Protected Attributes

 $tempStoreFactory
 
 $moduleHandler
 
 $nodeTypeStorage
 
 $validator
 

Detailed Description

Builds and process a form for editing a single entity field.

Constructor & Destructor Documentation

__construct ( PrivateTempStoreFactory  $temp_store_factory,
ModuleHandlerInterface  $module_handler,
EntityStorageInterface  $node_type_storage,
ValidatorInterface  $validator 
)

Constructs a new EditFieldForm.

Parameters
\Drupal\user\PrivateTempStoreFactory$temp_store_factoryThe tempstore factory.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.
\Drupal\Core\Entity\EntityStorageInterface$node_type_storageThe node type storage.
\Symfony\Component\Validator\Validator\ValidatorInterface$validatorThe typed data validator service.

References Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

buildForm ( array  $form,
FormStateInterface  $form_state,
EntityInterface  $entity = NULL,
  $field_name = NULL 
)

{}

Builds a form for a single entity field.

References FormStateInterface\get(), FormStateInterface\has(), QuickEditFieldForm\init(), QuickEditFieldForm\simplify(), and t().

Here is the call graph for this function:

static create ( ContainerInterface  $container)
static

{}

getFormId ( )

{}

init ( FormStateInterface  $form_state,
EntityInterface  $entity,
  $field_name 
)
protected

Initialize the form state and the entity before the first form build.

References EntityInterface\bundle(), EntityFormDisplay\collectRenderDisplay(), EntityInterface\getEntityTypeId(), and FormStateInterface\set().

Referenced by QuickEditFieldForm\buildForm().

Here is the call graph for this function:

Here is the caller graph for this function:

simplify ( array &  $form,
FormStateInterface  $form_state 
)
protected

Simplifies the field edit form for in-place editing.

This function:

  • Hides the field label inside the form, because JavaScript displays it outside the form.
  • Adjusts textarea elements to fit their content.
Parameters
array&$formA reference to an associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.

References Element\children(), and FormStateInterface\get().

Referenced by QuickEditFieldForm\buildForm().

Here is the call graph for this function:

Here is the caller graph for this function:

submitForm ( array &  $form,
FormStateInterface  $form_state 
)

{}

Saves the entity with updated values for the edited field.

References FormStateInterface\set().

Here is the call graph for this function:

validateForm ( array &  $form,
FormStateInterface  $form_state 
)

{}

References FormStateInterface\get().

Here is the call graph for this function:


The documentation for this class was generated from the following file: