You are here

public function SchemaPersonOrgBase::form in Schema.org Metatag 8

Generate a form element for this meta tag.

Parameters

array $element: The existing form element to attach to.

Return value

array The completed form element.

Overrides MetaNameBase::form

2 calls to SchemaPersonOrgBase::form()
SchemaPersonAffiliation::form in schema_person/src/Plugin/metatag/Tag/SchemaPersonAffiliation.php
Generate a form element for this meta tag.
SchemaWebPagePublisher::form in schema_web_page/src/Plugin/metatag/Tag/SchemaWebPagePublisher.php
Generate a form element for this meta tag.
2 methods override SchemaPersonOrgBase::form()
SchemaPersonAffiliation::form in schema_person/src/Plugin/metatag/Tag/SchemaPersonAffiliation.php
Generate a form element for this meta tag.
SchemaWebPagePublisher::form in schema_web_page/src/Plugin/metatag/Tag/SchemaWebPagePublisher.php
Generate a form element for this meta tag.

File

src/Plugin/metatag/Tag/SchemaPersonOrgBase.php, line 15

Class

SchemaPersonOrgBase
Schema.org Person/Org items should extend this class.

Namespace

Drupal\schema_metatag\Plugin\metatag\Tag

Code

public function form(array $element = []) {
  $value = $this
    ->schemaMetatagManager()
    ->unserialize($this
    ->value());
  $input_values = [
    'title' => $this
      ->label(),
    'description' => $this
      ->description(),
    'value' => $value,
    '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
    'visibility_selector' => $this
      ->visibilitySelector(),
  ];
  $form = $this
    ->personOrgForm($input_values);
  if (empty($this
    ->multiple())) {
    unset($form['pivot']);
  }
  return $form;
}