Skip to content

AnalyticsServiceForm

Form handler for adding and editing analytics services.


  • Full name: \Drupal\analytics\Form\AnalyticsServiceForm
  • Parent class: EntityForm

Properties

entity

The entity being used by this form.

protected \Drupal\analytics\Entity\AnalyticsServiceInterface $entity

analyticsServiceManager

The analytics service plugin manager.

protected \Drupal\analytics\AnalyticsServiceManager $analyticsServiceManager

Methods

__construct

Constructs on AnalyticsServiceForm object.

public __construct(\Drupal\analytics\AnalyticsServiceManager $analytics_service_manager): mixed

Parameters:

Parameter Type Description
$analytics_service_manager \Drupal\analytics\AnalyticsServiceManager
The analytics service.

create

{@inheritdoc}

public static create(\Symfony\Component\DependencyInjection\ContainerInterface $container): static
  • This method is static. Parameters:
Parameter Type Description
$container \Symfony\Component\DependencyInjection\ContainerInterface

form

{@inheritdoc}

public form(array $form, \Drupal\Core\Form\FormStateInterface $form_state): mixed

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface

getPluginSubFormState

Gets subform state for the plugin configuration subform.

protected getPluginSubFormState(array $form, \Drupal\Core\Form\FormStateInterface $form_state): \Drupal\Core\Form\SubformStateInterface

Parameters:

Parameter Type Description
$form array
Full form array.
$form_state \Drupal\Core\Form\FormStateInterface
Parent form state.

Return Value:

Sub-form state for the media source configuration form.


validateForm

{@inheritdoc}

public validateForm(array& $form, \Drupal\Core\Form\FormStateInterface $form_state): mixed

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface

submitForm

{@inheritdoc}

public submitForm(array& $form, \Drupal\Core\Form\FormStateInterface $form_state): mixed

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface

save

{@inheritdoc}

public save(array $form, \Drupal\Core\Form\FormStateInterface $form_state): int

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface

updateServiceSettings

Ajax callback to update the form fields which depend on analytics service.

public updateServiceSettings(array $form, \Drupal\Core\Form\FormStateInterface $form_state): mixed

Parameters:

Parameter Type Description
$form array
$form_state \Drupal\Core\Form\FormStateInterface